ropilot 0.1.12 → 0.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.
- package/bin/ropilot.js +8 -5
- package/package.json +1 -1
package/bin/ropilot.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* ropilot update - Update prompts and configs to latest version
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { fileURLToPath } from 'url';
|
|
14
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
15
15
|
import { dirname, join } from 'path';
|
|
16
16
|
import { existsSync, readFileSync } from 'fs';
|
|
17
17
|
|
|
@@ -19,6 +19,9 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
19
19
|
const __dirname = dirname(__filename);
|
|
20
20
|
const libDir = join(__dirname, '..', 'lib');
|
|
21
21
|
|
|
22
|
+
// Convert path to file:// URL for ES module imports (required on Windows)
|
|
23
|
+
const toImportURL = (path) => pathToFileURL(path).href;
|
|
24
|
+
|
|
22
25
|
// Get version from package.json
|
|
23
26
|
function getVersion() {
|
|
24
27
|
try {
|
|
@@ -69,26 +72,26 @@ async function main() {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
case 'init': {
|
|
72
|
-
const { init } = await import(join(libDir, 'setup.js'));
|
|
75
|
+
const { init } = await import(toImportURL(join(libDir, 'setup.js')));
|
|
73
76
|
const apiKey = args[1] || null;
|
|
74
77
|
await init(apiKey);
|
|
75
78
|
break;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
case 'update': {
|
|
79
|
-
const { update } = await import(join(libDir, 'setup.js'));
|
|
82
|
+
const { update } = await import(toImportURL(join(libDir, 'setup.js')));
|
|
80
83
|
await update();
|
|
81
84
|
break;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
case 'config': {
|
|
85
|
-
const { showConfig } = await import(join(libDir, 'config.js'));
|
|
88
|
+
const { showConfig } = await import(toImportURL(join(libDir, 'config.js')));
|
|
86
89
|
await showConfig();
|
|
87
90
|
break;
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
case 'serve': {
|
|
91
|
-
const { serve } = await import(join(libDir, 'proxy.js'));
|
|
94
|
+
const { serve } = await import(toImportURL(join(libDir, 'proxy.js')));
|
|
92
95
|
await serve();
|
|
93
96
|
break;
|
|
94
97
|
}
|