pinokiod 2.1.17 → 2.1.20
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/kernel/bin/index.js +11 -3
- package/kernel/shell.js +9 -0
- package/package.json +1 -1
package/kernel/bin/index.js
CHANGED
|
@@ -112,6 +112,7 @@ class Bin {
|
|
|
112
112
|
merge_env(existing, merge) {
|
|
113
113
|
// merge 'merge' into 'existing'
|
|
114
114
|
for(let key in merge) {
|
|
115
|
+
// Array => like PATH
|
|
115
116
|
if (Array.isArray(merge[key])) {
|
|
116
117
|
if (typeof existing[key] === 'undefined') {
|
|
117
118
|
existing[key] = merge[key]
|
|
@@ -134,10 +135,17 @@ class Bin {
|
|
|
134
135
|
|
|
135
136
|
// 1. get the module envs
|
|
136
137
|
let envs = this.mods.map((mod) => {
|
|
137
|
-
if (mod.
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
if (mod.name === "vs") {
|
|
139
|
+
// don't include vs now
|
|
140
|
+
// instead, include it after conda activation, since this should be top priority and even higher priority than conda activated environment variables
|
|
141
|
+
this.vs_path_env = mod.mod.env(this.kernel)
|
|
140
142
|
return null
|
|
143
|
+
} else {
|
|
144
|
+
if (mod.mod.env) {
|
|
145
|
+
return mod.mod.env(this.kernel)
|
|
146
|
+
} else {
|
|
147
|
+
return null
|
|
148
|
+
}
|
|
141
149
|
}
|
|
142
150
|
}).filter(x => x)
|
|
143
151
|
|
package/kernel/shell.js
CHANGED
|
@@ -511,6 +511,7 @@ class Shell {
|
|
|
511
511
|
|
|
512
512
|
|
|
513
513
|
// 2. conda_activation
|
|
514
|
+
|
|
514
515
|
let conda_activation = []
|
|
515
516
|
if (conda_path) {
|
|
516
517
|
let env_path = path.resolve(params.path, conda_path)
|
|
@@ -570,6 +571,14 @@ class Shell {
|
|
|
570
571
|
conda_activation = []
|
|
571
572
|
}
|
|
572
573
|
|
|
574
|
+
// Visual Studio Build Tools (Exception)
|
|
575
|
+
const vs_path_env = this.kernel.bin.vs_path_env
|
|
576
|
+
console.log({ vs_path_env })
|
|
577
|
+
if (vs_path_env && vs_path_env.PATH) {
|
|
578
|
+
const vs = `conda env config vars set ${vs_path_env.PATH.join(path.delimiter)}${path.delimiter}%PATH%`
|
|
579
|
+
console.log({ vs })
|
|
580
|
+
conda_activation.push(vs)
|
|
581
|
+
}
|
|
573
582
|
|
|
574
583
|
|
|
575
584
|
// Update env setting
|