pinokiod 3.3.50 → 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/index.js +19 -0
- package/kernel/shell.js +7 -1
- package/package.json +1 -1
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",
|