@wipcomputer/wip-repo-init 1.9.31 → 1.9.33
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/init.mjs +7 -1
- package/package.json +1 -1
package/init.mjs
CHANGED
|
@@ -9,12 +9,18 @@
|
|
|
9
9
|
// 2. Moves old ai/ contents into ai/_sort/ai_old/
|
|
10
10
|
// 3. You sort from there at your own pace.
|
|
11
11
|
|
|
12
|
-
import { existsSync, mkdirSync, cpSync, renameSync, readdirSync, statSync } from 'node:fs';
|
|
12
|
+
import { existsSync, mkdirSync, cpSync, renameSync, readdirSync, statSync, readFileSync } from 'node:fs';
|
|
13
13
|
import { join, resolve, dirname } from 'node:path';
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
15
|
import { createInterface } from 'node:readline';
|
|
16
16
|
|
|
17
17
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
|
|
19
|
+
if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
20
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));
|
|
21
|
+
console.log(pkg.version);
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
18
24
|
const TEMPLATE = join(__dirname, 'templates');
|
|
19
25
|
|
|
20
26
|
const targetRepo = resolve(process.argv[2] || process.cwd());
|