pinokiod 1.1.21 → 1.1.22
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/sysinfo.js +21 -1
- package/package.json +1 -1
package/kernel/sysinfo.js
CHANGED
|
@@ -102,8 +102,28 @@ class Sysinfo {
|
|
|
102
102
|
}
|
|
103
103
|
let res = await this.kernel.bin.exec({ message: cmd, conda: "base" }, (stream) => {
|
|
104
104
|
})
|
|
105
|
+
let lines = res.response.split(/[\r\n]+/)
|
|
106
|
+
let vars = []
|
|
107
|
+
let started
|
|
108
|
+
for(let line of lines) {
|
|
109
|
+
if (started) {
|
|
110
|
+
// end BEFORE the next occurrence of <<PINOKIO SHELL>>
|
|
111
|
+
if (/<<PINOKIO SHELL>>/.test(line)) {
|
|
112
|
+
// do nothing => ignore this line
|
|
113
|
+
} else {
|
|
114
|
+
vars.push(line)
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
// start AFTER the first occurrence of <<PINOKIO SHELL>>
|
|
118
|
+
if (/<<PINOKIO SHELL>>/.test(line)) {
|
|
119
|
+
started = true
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
105
125
|
this.info.env = process.env
|
|
106
|
-
this.info.shell_env =
|
|
126
|
+
this.info.shell_env = vars
|
|
107
127
|
}
|
|
108
128
|
}
|
|
109
129
|
module.exports = Sysinfo
|