syncdotfile 1.0.0 → 1.0.1
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/index.js +11 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6,6 +6,12 @@ import os from "node:os";
|
|
|
6
6
|
import readline from "node:readline";
|
|
7
7
|
import { execSync } from "node:child_process";
|
|
8
8
|
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Version (read from package.json at module root)
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
13
|
+
const PKG = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf-8"));
|
|
14
|
+
|
|
9
15
|
// ---------------------------------------------------------------------------
|
|
10
16
|
// Paths
|
|
11
17
|
// ---------------------------------------------------------------------------
|
|
@@ -615,6 +621,11 @@ ${color.cyan("Example:")}
|
|
|
615
621
|
const command = process.argv[2];
|
|
616
622
|
|
|
617
623
|
switch (command) {
|
|
624
|
+
case "-v":
|
|
625
|
+
case "--version":
|
|
626
|
+
case "version":
|
|
627
|
+
console.log(PKG.version);
|
|
628
|
+
break;
|
|
618
629
|
case "init":
|
|
619
630
|
init();
|
|
620
631
|
break;
|