balena-cli/patches/unix/node-gyp-build+4.2.3.patch
Paulo Castro e8eb031253 Live push: Accept Dockerfile ENV instructions in live push to local device
Update livepush, chokidar and @types/dockerode dependencies

Change-type: minor
2020-08-07 21:09:47 +01:00

15 lines
667 B
Diff

diff --git a/node_modules/node-gyp-build/index.js b/node_modules/node-gyp-build/index.js
index b5096ed..7cd451a 100644
--- a/node_modules/node-gyp-build/index.js
+++ b/node_modules/node-gyp-build/index.js
@@ -29,6 +29,9 @@ load.path = function (dir) {
if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']
} catch (err) {}
+ // pkg fix: native node modules are located externally to the pkg executable
+ dir = dir.replace(/^\/snapshot\/.+?\/node_modules\//, path.dirname(process.execPath) + path.sep)
+
if (!prebuildsOnly) {
var release = getFirst(path.join(dir, 'build/Release'), matchBuild)
if (release) return release