opendraft 1.6.0 → 1.6.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/bin/opendraft.js +28 -13
- package/package.json +1 -1
package/bin/opendraft.js
CHANGED
|
@@ -48,15 +48,22 @@ ${PURPLE}${BOLD} ╔═══════════════════
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function checkPython() {
|
|
51
|
-
|
|
51
|
+
const home = os.homedir();
|
|
52
|
+
|
|
53
|
+
// Check various Python commands including conda, pyenv, Homebrew, python.org
|
|
52
54
|
const pythonCommands = [
|
|
53
55
|
'python3',
|
|
54
56
|
'python',
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
// Conda (common locations)
|
|
58
|
+
`${home}/anaconda3/bin/python`,
|
|
59
|
+
`${home}/miniconda3/bin/python`,
|
|
60
|
+
`${home}/miniforge3/bin/python`,
|
|
61
|
+
`${home}/mambaforge/bin/python`,
|
|
62
|
+
'/opt/anaconda3/bin/python',
|
|
63
|
+
'/opt/miniconda3/bin/python',
|
|
64
|
+
// pyenv
|
|
65
|
+
`${home}/.pyenv/shims/python3`,
|
|
66
|
+
`${home}/.pyenv/shims/python`,
|
|
60
67
|
// Homebrew
|
|
61
68
|
'/opt/homebrew/bin/python3',
|
|
62
69
|
'/opt/homebrew/bin/python3.13',
|
|
@@ -68,6 +75,12 @@ function checkPython() {
|
|
|
68
75
|
'/Library/Frameworks/Python.framework/Versions/3.12/bin/python3',
|
|
69
76
|
'/Library/Frameworks/Python.framework/Versions/3.11/bin/python3',
|
|
70
77
|
'/Library/Frameworks/Python.framework/Versions/3.10/bin/python3',
|
|
78
|
+
// Versioned commands (fallback)
|
|
79
|
+
'python3.13',
|
|
80
|
+
'python3.12',
|
|
81
|
+
'python3.11',
|
|
82
|
+
'python3.10',
|
|
83
|
+
'python3.9',
|
|
71
84
|
];
|
|
72
85
|
|
|
73
86
|
for (const cmd of pythonCommands) {
|
|
@@ -269,19 +282,24 @@ async function main() {
|
|
|
269
282
|
return;
|
|
270
283
|
}
|
|
271
284
|
|
|
285
|
+
// Show logo immediately so user knows something is happening
|
|
286
|
+
printLogo();
|
|
287
|
+
print(`${GRAY}Checking environment...${RESET}`);
|
|
288
|
+
|
|
272
289
|
// Check Python
|
|
273
290
|
const python = checkPython();
|
|
274
291
|
|
|
275
292
|
if (!python) {
|
|
276
|
-
|
|
293
|
+
console.log();
|
|
277
294
|
showInstallInstructions();
|
|
278
295
|
process.exit(1);
|
|
279
296
|
}
|
|
280
297
|
|
|
298
|
+
print(`${GREEN}✓${RESET} Python ${python.version} found`);
|
|
299
|
+
|
|
281
300
|
// Handle --install
|
|
282
301
|
if (args.includes('--install')) {
|
|
283
|
-
|
|
284
|
-
print(`${GREEN}✓${RESET} Python ${python.version} found`);
|
|
302
|
+
print(`${GRAY}Installing OpenDraft...${RESET}`);
|
|
285
303
|
if (installOpendraft(python.cmd)) {
|
|
286
304
|
print(`${GREEN}✓${RESET} OpenDraft installed successfully`);
|
|
287
305
|
console.log();
|
|
@@ -296,15 +314,12 @@ async function main() {
|
|
|
296
314
|
|
|
297
315
|
// Check if opendraft is installed
|
|
298
316
|
if (!checkOpendraftInstalled(python.cmd)) {
|
|
299
|
-
|
|
300
|
-
print(`${YELLOW}First time setup...${RESET}`);
|
|
301
|
-
console.log();
|
|
317
|
+
print(`${YELLOW}First time setup - installing OpenDraft...${RESET}`);
|
|
302
318
|
if (!installOpendraft(python.cmd)) {
|
|
303
319
|
print(`${RED}✗${RESET} Failed to install OpenDraft`);
|
|
304
320
|
process.exit(1);
|
|
305
321
|
}
|
|
306
322
|
print(`${GREEN}✓${RESET} OpenDraft installed`);
|
|
307
|
-
console.log();
|
|
308
323
|
}
|
|
309
324
|
|
|
310
325
|
// Run opendraft
|