opendraft 1.4.6 → 1.4.7
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 +15 -2
- package/package.json +1 -1
package/bin/opendraft.js
CHANGED
|
@@ -129,15 +129,28 @@ function installOpendraft(pythonCmd) {
|
|
|
129
129
|
function runOpendraft(pythonCmd, args) {
|
|
130
130
|
const home = os.homedir();
|
|
131
131
|
|
|
132
|
+
// Get Python version to find the right Library path
|
|
133
|
+
let pyVersion = '';
|
|
134
|
+
try {
|
|
135
|
+
const versionOutput = execSync(`${pythonCmd} -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"`, { encoding: 'utf8' }).trim();
|
|
136
|
+
pyVersion = versionOutput;
|
|
137
|
+
} catch (e) {}
|
|
138
|
+
|
|
132
139
|
// Common locations for pip-installed commands
|
|
133
140
|
const possiblePaths = [
|
|
134
141
|
'opendraft', // In PATH
|
|
135
142
|
`${home}/.local/bin/opendraft`, // pip --user on Linux/Mac
|
|
136
|
-
`${home}/Library/Python/
|
|
137
|
-
`${home}/Library/Python/3.12/bin/opendraft`, // macOS Python 3.12
|
|
143
|
+
`${home}/Library/Python/${pyVersion}/bin/opendraft`, // macOS user install for detected version
|
|
138
144
|
`${home}/Library/Python/3.13/bin/opendraft`, // macOS Python 3.13
|
|
145
|
+
`${home}/Library/Python/3.12/bin/opendraft`, // macOS Python 3.12
|
|
146
|
+
`${home}/Library/Python/3.11/bin/opendraft`, // macOS Python 3.11
|
|
147
|
+
`${home}/Library/Python/3.10/bin/opendraft`, // macOS Python 3.10
|
|
148
|
+
`${home}/Library/Python/3.9/bin/opendraft`, // macOS Python 3.9
|
|
139
149
|
'/opt/homebrew/bin/opendraft', // Homebrew
|
|
140
150
|
'/usr/local/bin/opendraft', // System-wide
|
|
151
|
+
'/Library/Frameworks/Python.framework/Versions/3.13/bin/opendraft',
|
|
152
|
+
'/Library/Frameworks/Python.framework/Versions/3.12/bin/opendraft',
|
|
153
|
+
'/Library/Frameworks/Python.framework/Versions/3.11/bin/opendraft',
|
|
141
154
|
];
|
|
142
155
|
|
|
143
156
|
// Try each possible path
|