balena-cli/patches/mmmagic+0.5.3.patch
2020-02-07 18:19:10 +00:00

15 lines
551 B
Diff

diff --git a/node_modules/mmmagic/lib/index.js b/node_modules/mmmagic/lib/index.js
index bd18a4b..a19a149 100644
--- a/node_modules/mmmagic/lib/index.js
+++ b/node_modules/mmmagic/lib/index.js
@@ -1,5 +1,8 @@
var Magic = require('../build/Release/magic');
-var fbpath = require('path').join(__dirname, '..', 'magic', 'magic');
+var path = require('path');
+var fbpath = process.pkg
+ ? path.join(path.dirname(process.execPath), 'mmmagic', 'magic')
+ : path.join(__dirname, '..', 'magic', 'magic');
Magic.setFallback(fbpath);
module.exports = {