forge-sql-orm 1.0.13 → 1.0.15
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/dist-cli/forgeSqlCLI.js +3 -12
- package/package.json +1 -1
package/dist-cli/forgeSqlCLI.js
CHANGED
|
@@ -10,9 +10,6 @@ const args = process.argv.slice(2).join(" ");
|
|
|
10
10
|
// Resolve the path to cli.ts (your TypeScript entry file)
|
|
11
11
|
const cliPath = path.resolve(__dirname, "cli.js");
|
|
12
12
|
|
|
13
|
-
// Detect platform-specific `ts-node` binary paths
|
|
14
|
-
const localTsNode = path.resolve(__dirname, "../node_modules/.bin/ts-node") + (os.platform() === "win32" ? ".cmd" : "");
|
|
15
|
-
|
|
16
13
|
// Function to run a command
|
|
17
14
|
const runCommand = (cmd) => {
|
|
18
15
|
try {
|
|
@@ -36,15 +33,9 @@ const isGlobalTsNodeInstalled = (() => {
|
|
|
36
33
|
|
|
37
34
|
if (isGlobalTsNodeInstalled) {
|
|
38
35
|
console.log("✅ Using global ts-node");
|
|
39
|
-
runCommand(`ts-node ${cliPath} ${args}`);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// **2. If not, check for local ts-node**
|
|
43
|
-
if (fs.existsSync(localTsNode)) {
|
|
44
|
-
console.log("✅ Using local ts-node");
|
|
45
|
-
runCommand(`"${localTsNode}" ${cliPath} ${args}`);
|
|
36
|
+
runCommand(`node -r ts-node/register ${cliPath} ${args}`);
|
|
46
37
|
}
|
|
47
38
|
|
|
48
|
-
// **3.
|
|
39
|
+
// **3. fallback to npx**
|
|
49
40
|
console.warn("⚠️ Neither global nor local ts-node found, using npx...");
|
|
50
|
-
runCommand(`node -r ts-node/register ${cliPath} ${args}`);
|
|
41
|
+
runCommand(`npx node -r ts-node/register ${cliPath} ${args}`);
|