pinokiod 7.1.42 → 7.1.43
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/bluefairy.js +10 -0
- package/package.json +1 -1
package/kernel/bin/bluefairy.js
CHANGED
|
@@ -97,6 +97,16 @@ class Bluefairy {
|
|
|
97
97
|
|
|
98
98
|
async install(req, ondata) {
|
|
99
99
|
const spec = this.packageSpec().replaceAll('"', '\\"')
|
|
100
|
+
const runtimeHome = this.runtimeHome()
|
|
101
|
+
if (fs.existsSync(runtimeHome)) {
|
|
102
|
+
try {
|
|
103
|
+
await fs.promises.rm(runtimeHome, { recursive: true, force: true })
|
|
104
|
+
ondata({ raw: `Removed existing Bluefairy runtime: ${runtimeHome}\r\n` })
|
|
105
|
+
} catch (error) {
|
|
106
|
+
const message = error && error.message ? error.message : String(error)
|
|
107
|
+
ondata({ raw: `Warning: failed to remove Bluefairy runtime ${runtimeHome}: ${message}\r\n` })
|
|
108
|
+
}
|
|
109
|
+
}
|
|
100
110
|
await this.kernel.exec({
|
|
101
111
|
message: `npm install -g "${spec}" --force`,
|
|
102
112
|
}, ondata)
|