mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-17 10:20:25 +00:00
Merge pull request #1213 from balena-io/977-denymount-pkg
Fix 'local configure' on macOS standalone installation
This commit is contained in:
commit
53bee83047
@ -14,6 +14,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
import * as Bluebird from 'bluebird';
|
||||||
import * as filehound from 'filehound';
|
import * as filehound from 'filehound';
|
||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
@ -24,12 +25,22 @@ const ROOT = path.join(__dirname, '..');
|
|||||||
console.log('Building package...\n');
|
console.log('Building package...\n');
|
||||||
|
|
||||||
execPkg(['--target', 'host', '--output', 'build-bin/balena', 'package.json'])
|
execPkg(['--target', 'host', '--output', 'build-bin/balena', 'package.json'])
|
||||||
.then(() =>
|
.then(() => {
|
||||||
fs.copy(
|
const xpaths: Array<[string, string[]]> = [
|
||||||
path.join(ROOT, 'node_modules', 'opn', 'xdg-open'),
|
// [platform, [path, to, file]]
|
||||||
path.join(ROOT, 'build-bin', 'xdg-open'),
|
['*', ['opn', 'xdg-open']],
|
||||||
),
|
['darwin', ['denymount', 'bin', 'denymount']],
|
||||||
)
|
];
|
||||||
|
return Bluebird.map(xpaths, ([platform, xpath]) => {
|
||||||
|
if (platform === '*' || platform === process.platform) {
|
||||||
|
// eg copy from node_modules/opn/xdg-open to build-bin/xdg-open
|
||||||
|
return fs.copy(
|
||||||
|
path.join(ROOT, 'node_modules', ...xpath),
|
||||||
|
path.join(ROOT, 'build-bin', xpath.pop()!),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).return();
|
||||||
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
return filehound
|
return filehound
|
||||||
.create()
|
.create()
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rimraf build/ build-bin/ build-zip/",
|
"prebuild": "rimraf build/ build-bin/ build-zip/ && patch-package",
|
||||||
"build": "npm run build:src && npm run build:bin",
|
"build": "npm run build:src && npm run build:bin",
|
||||||
"build:src": "npm run prettify && npm run lint && npm run build:fast && npm run build:doc",
|
"build:src": "npm run prettify && npm run lint && npm run build:fast && npm run build:doc",
|
||||||
"build:fast": "gulp build && tsc",
|
"build:fast": "gulp build && tsc",
|
||||||
@ -91,6 +91,7 @@
|
|||||||
"gulp-mocha": "^2.0.0",
|
"gulp-mocha": "^2.0.0",
|
||||||
"gulp-shell": "^0.5.2",
|
"gulp-shell": "^0.5.2",
|
||||||
"mochainon": "^2.0.0",
|
"mochainon": "^2.0.0",
|
||||||
|
"patch-package": "^6.1.2",
|
||||||
"pkg": "^4.3.8",
|
"pkg": "^4.3.8",
|
||||||
"prettier": "^1.17.0",
|
"prettier": "^1.17.0",
|
||||||
"publish-release": "^1.3.3",
|
"publish-release": "^1.3.3",
|
||||||
@ -125,7 +126,7 @@
|
|||||||
"color-hash": "^1.0.3",
|
"color-hash": "^1.0.3",
|
||||||
"columnify": "^1.5.2",
|
"columnify": "^1.5.2",
|
||||||
"common-tags": "^1.7.2",
|
"common-tags": "^1.7.2",
|
||||||
"denymount": "^2.2.0",
|
"denymount": "~2.2.0",
|
||||||
"docker-progress": "^4.0.0",
|
"docker-progress": "^4.0.0",
|
||||||
"docker-qemu-transpose": "^0.5.3",
|
"docker-qemu-transpose": "^0.5.3",
|
||||||
"docker-toolbelt": "^3.3.7",
|
"docker-toolbelt": "^3.3.7",
|
||||||
|
38
patches/denymount+2.2.0.patch
Normal file
38
patches/denymount+2.2.0.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
diff --git a/node_modules/denymount/lib/index.js b/node_modules/denymount/lib/index.js
|
||||||
|
index 93b8e59..86d53dc 100644
|
||||||
|
--- a/node_modules/denymount/lib/index.js
|
||||||
|
+++ b/node_modules/denymount/lib/index.js
|
||||||
|
@@ -24,7 +24,9 @@ var utils = require('./utils');
|
||||||
|
* @module denymount
|
||||||
|
*/
|
||||||
|
|
||||||
|
-var EXECUTABLE_PATH = path.join(__dirname, '..', 'bin', 'denymount');
|
||||||
|
+var EXECUTABLE_PATH = process.pkg
|
||||||
|
+ ? path.join(path.dirname(process.execPath), 'denymount')
|
||||||
|
+ : path.join(__dirname, '..', 'bin', 'denymount');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Prevent automatic mounting of an OS X disk
|
||||||
|
diff --git a/node_modules/denymount/lib/index.js.rej b/node_modules/denymount/lib/index.js.rej
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..a2c0516
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/node_modules/denymount/lib/index.js.rej
|
||||||
|
@@ -0,0 +1,17 @@
|
||||||
|
+***************
|
||||||
|
+*** 24,30 ****
|
||||||
|
+ * @module denymount
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+- var EXECUTABLE_PATH = path.join(__dirname, '..', 'bin', 'denymount');
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * @summary Prevent automatic mounting of an OS X disk
|
||||||
|
+--- 24,30 ----
|
||||||
|
+ * @module denymount
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
++ var EXECUTABLE_PATH = path.join(path.dirname(process.execPath), 'denymount', 'bin', 'denymount');
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * @summary Prevent automatic mounting of an OS X disk
|
Loading…
Reference in New Issue
Block a user