bayda-maghreb 1.1.12 → 1.1.14

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.
Files changed (2) hide show
  1. package/bayda-bin +35 -0
  2. package/package.json +1 -1
package/bayda-bin CHANGED
@@ -1,4 +1,39 @@
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
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
8
+ const args = process.argv.slice(2);
9
+ const isTermux = !!process.env.TERMUX_VERSION || (process.env.PREFIX && process.env.PREFIX.includes('com.termux'));
10
+ if (args.includes('--version') || args.includes('-v')) {
11
+ try { const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8')); console.log(pkg.version); } catch { console.log('1.1.14'); }
12
+ process.exit(0);
13
+ }
14
+ if (args.includes('--help') || args.includes('-h')) {
15
+ if (isTermux) {
16
+ console.log(`
17
+ bayda-maghreb - logha bayda b-darja
18
+
19
+ Haw kifach:
20
+ bayda <file> khaddem dossi l-bayda
21
+ bayda init 7el proji jdid
22
+ bayda --version warri l-copy
23
+ bayda --help warri s-support
24
+ `);
25
+ } else {
26
+ console.log(`
27
+ bayda-maghreb - لغة بيضا بالدارجة
28
+
29
+ هــاو كــيـفــاش:
30
+ bayda <file> خـدّم دوسـي لـبـيـضـا
31
+ bayda init حـل پـروجـي جـديـد
32
+ bayda --version ورّي لـكـوپـي
33
+ bayda --help ورّي الـسّوپـور
34
+ `);
35
+ }
36
+ process.exit(0);
37
+ }
3
38
  const require = createRequire(import.meta.url);
4
39
  require('./bayda-transpile.cjs');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bayda-maghreb",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "Bayda Maghreb - 7 dialects clean + Gen 2 Tech",
5
5
  "main": "index.js",
6
6
  "bin": {