pinokiod 3.3.49 → 3.3.52
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/vs.js +3 -4
- package/kernel/index.js +19 -0
- package/kernel/shell.js +7 -1
- package/package.json +1 -1
package/kernel/bin/vs.js
CHANGED
|
@@ -117,7 +117,7 @@ class VS {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
console.log("vs.init() this._env=", this.
|
|
120
|
+
console.log("vs.init() this._env=", this._env)
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
env () {
|
|
@@ -127,10 +127,9 @@ class VS {
|
|
|
127
127
|
}
|
|
128
128
|
async installed() {
|
|
129
129
|
if (this.kernel.platform === "win32") {
|
|
130
|
-
let paths = await this.getpaths()
|
|
131
|
-
console.log("VS INSTALLED CHECK", paths)
|
|
132
130
|
await this.init()
|
|
133
|
-
|
|
131
|
+
console.log("VS INSTALLED CHECK", this._env)
|
|
132
|
+
return this._env.MSVC_PATH && this._env.MSVC_PATH.length > 0 && this._env.BUILD_PATH && this._env.BUILD_PATH.length > 0 && this._env.CMAKE_PATH && this._env.CMAKE_PATH.length > 0 && this._env.VCVARSALL_PATH && this._env.VCVARSALL_PATH.length > 0
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
package/kernel/index.js
CHANGED
|
@@ -351,6 +351,25 @@ class Kernel {
|
|
|
351
351
|
})
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
+
which(name) {
|
|
355
|
+
console.log("which", this.envs.PATH)
|
|
356
|
+
if (this.platform === "win32") {
|
|
357
|
+
try {
|
|
358
|
+
const result = execSync(`where ${name}`, { env: this.envs, encoding: "utf-8" })
|
|
359
|
+
const lines = result.trim().split("\r\n")
|
|
360
|
+
if (lines.length > 0) {
|
|
361
|
+
return lines[0]
|
|
362
|
+
} else {
|
|
363
|
+
return null
|
|
364
|
+
}
|
|
365
|
+
} catch (e) {
|
|
366
|
+
console.log(`>> which ${name}`, e)
|
|
367
|
+
return null
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
return which.sync(name, { nothrow: true, path: this.envs.PATH })
|
|
371
|
+
}
|
|
372
|
+
}
|
|
354
373
|
|
|
355
374
|
async init(options) {
|
|
356
375
|
let home = this.store.get("home")
|
package/kernel/shell.js
CHANGED
|
@@ -156,7 +156,11 @@ class Shell {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
if (this.platform === "linux") {
|
|
159
|
-
this.
|
|
159
|
+
let gxx = this.kernel.which('g++')
|
|
160
|
+
console.log({ gxx })
|
|
161
|
+
if (gxx) {
|
|
162
|
+
this.env.NVCC_PREPEND_FLAGS = `-ccbin ${gxx}`
|
|
163
|
+
}
|
|
160
164
|
}
|
|
161
165
|
|
|
162
166
|
this.env[PATH_KEY] = this.env[PATH_KEY] + path.delimiter + path.resolve(this.kernel.homedir, 'bin')
|
|
@@ -221,6 +225,8 @@ class Shell {
|
|
|
221
225
|
// automatically add self to the shells registry
|
|
222
226
|
this.kernel.shell.add(this)
|
|
223
227
|
|
|
228
|
+
console.log("this.env", this.env)
|
|
229
|
+
|
|
224
230
|
if (params.sudo) {
|
|
225
231
|
let options = {
|
|
226
232
|
name: "Pinokio",
|