bayda-maghreb 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bayda-bin +31 -0
- package/package.json +1 -1
package/bayda-bin
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
|
|
11
|
+
if (args.includes('--version') || args.includes('-v') || args.includes('version')) {
|
|
12
|
+
try {
|
|
13
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));
|
|
14
|
+
console.log(pkg.version);
|
|
15
|
+
} catch {
|
|
16
|
+
console.log('1.1.12');
|
|
17
|
+
}
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
22
|
+
console.log(`
|
|
23
|
+
bayda-maghreb - لغة برمجة بيضاء مغاربية
|
|
24
|
+
|
|
25
|
+
Usage:
|
|
26
|
+
bayda <file> شغل ملف
|
|
27
|
+
bayda init انشاء مشروع جديد
|
|
28
|
+
bayda --version عرض النسخة
|
|
29
|
+
bayda --help المساعدة
|
|
30
|
+
`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
3
34
|
const require = createRequire(import.meta.url);
|
|
4
35
|
require('./bayda-transpile.cjs');
|