opendraft 1.6.1 → 1.6.2
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 +21 -16
- package/package.json +1 -1
package/bin/opendraft.js
CHANGED
|
@@ -50,10 +50,21 @@ ${PURPLE}${BOLD} ╔═══════════════════
|
|
|
50
50
|
function checkPython() {
|
|
51
51
|
const home = os.homedir();
|
|
52
52
|
|
|
53
|
-
// Check
|
|
53
|
+
// Check Python commands - prefer stable versions (3.9-3.13), avoid dev versions (3.14+)
|
|
54
|
+
// Order matters: check specific stable versions first before generic python3
|
|
54
55
|
const pythonCommands = [
|
|
55
|
-
|
|
56
|
-
'
|
|
56
|
+
// Homebrew (stable versions first)
|
|
57
|
+
'/opt/homebrew/bin/python3.13',
|
|
58
|
+
'/opt/homebrew/bin/python3.12',
|
|
59
|
+
'/opt/homebrew/bin/python3.11',
|
|
60
|
+
'/opt/homebrew/bin/python3.10',
|
|
61
|
+
'/opt/homebrew/bin/python3',
|
|
62
|
+
'/usr/local/bin/python3',
|
|
63
|
+
// python.org macOS installer
|
|
64
|
+
'/Library/Frameworks/Python.framework/Versions/3.13/bin/python3',
|
|
65
|
+
'/Library/Frameworks/Python.framework/Versions/3.12/bin/python3',
|
|
66
|
+
'/Library/Frameworks/Python.framework/Versions/3.11/bin/python3',
|
|
67
|
+
'/Library/Frameworks/Python.framework/Versions/3.10/bin/python3',
|
|
57
68
|
// Conda (common locations)
|
|
58
69
|
`${home}/anaconda3/bin/python`,
|
|
59
70
|
`${home}/miniconda3/bin/python`,
|
|
@@ -64,23 +75,16 @@ function checkPython() {
|
|
|
64
75
|
// pyenv
|
|
65
76
|
`${home}/.pyenv/shims/python3`,
|
|
66
77
|
`${home}/.pyenv/shims/python`,
|
|
67
|
-
//
|
|
68
|
-
'/opt/homebrew/bin/python3',
|
|
69
|
-
'/opt/homebrew/bin/python3.13',
|
|
70
|
-
'/opt/homebrew/bin/python3.12',
|
|
71
|
-
'/opt/homebrew/bin/python3.11',
|
|
72
|
-
'/usr/local/bin/python3',
|
|
73
|
-
// python.org macOS installer
|
|
74
|
-
'/Library/Frameworks/Python.framework/Versions/3.13/bin/python3',
|
|
75
|
-
'/Library/Frameworks/Python.framework/Versions/3.12/bin/python3',
|
|
76
|
-
'/Library/Frameworks/Python.framework/Versions/3.11/bin/python3',
|
|
77
|
-
'/Library/Frameworks/Python.framework/Versions/3.10/bin/python3',
|
|
78
|
-
// Versioned commands (fallback)
|
|
78
|
+
// Generic (last resort - may pick dev versions)
|
|
79
79
|
'python3.13',
|
|
80
80
|
'python3.12',
|
|
81
81
|
'python3.11',
|
|
82
82
|
'python3.10',
|
|
83
83
|
'python3.9',
|
|
84
|
+
'python3',
|
|
85
|
+
'python',
|
|
86
|
+
// System Python (macOS)
|
|
87
|
+
'/usr/bin/python3',
|
|
84
88
|
];
|
|
85
89
|
|
|
86
90
|
for (const cmd of pythonCommands) {
|
|
@@ -90,7 +94,8 @@ function checkPython() {
|
|
|
90
94
|
if (match) {
|
|
91
95
|
const major = parseInt(match[1]);
|
|
92
96
|
const minor = parseInt(match[2]);
|
|
93
|
-
|
|
97
|
+
// Require Python 3.9-3.13 (3.14+ is dev/unstable, packages may not work)
|
|
98
|
+
if (major === 3 && minor >= 9 && minor <= 13) {
|
|
94
99
|
return { cmd, version: `${major}.${minor}` };
|
|
95
100
|
}
|
|
96
101
|
}
|