@safedep/pmg 0.0.6 → 0.0.7
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/install.js +12 -2
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -192,8 +192,18 @@ async function install() {
|
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
// Move binary to final location
|
|
196
|
-
|
|
195
|
+
// Move binary to final location (handle cross-device links)
|
|
196
|
+
try {
|
|
197
|
+
fs.renameSync(extractedBinaryPath, finalBinaryPath);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
if (error.code === "EXDEV") {
|
|
200
|
+
// Cross-device link not permitted, copy and delete instead
|
|
201
|
+
fs.copyFileSync(extractedBinaryPath, finalBinaryPath);
|
|
202
|
+
fs.unlinkSync(extractedBinaryPath);
|
|
203
|
+
} else {
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
197
207
|
|
|
198
208
|
// Make executable on Unix systems
|
|
199
209
|
if (process.platform !== "win32") {
|
package/package.json
CHANGED