mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-23 15:32:22 +00:00
Merge pull request #1659 from balena-io/1657-xdg-open-ENOENT
Fix 'balena login' web auth on Linux standalone zip install (xdg-open ENOENT)
This commit is contained in:
commit
d7633b5f08
@ -98,6 +98,7 @@ async function buildPkg() {
|
|||||||
const paths: Array<[string, string[], string[]]> = [
|
const paths: Array<[string, string[], string[]]> = [
|
||||||
// [platform, [source path], [destination path]]
|
// [platform, [source path], [destination path]]
|
||||||
['*', ['open', 'xdg-open'], ['xdg-open']],
|
['*', ['open', 'xdg-open'], ['xdg-open']],
|
||||||
|
['*', ['opn-cli', 'node_modules', 'opn', 'xdg-open'], ['xdg-open-402']],
|
||||||
['darwin', ['denymount', 'bin', 'denymount'], ['denymount']],
|
['darwin', ['denymount', 'bin', 'denymount'], ['denymount']],
|
||||||
];
|
];
|
||||||
await Bluebird.map(paths, ([platform, source, dest]) => {
|
await Bluebird.map(paths, ([platform, source, dest]) => {
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
"build/auth/pages/*.ejs",
|
"build/auth/pages/*.ejs",
|
||||||
"build/hooks",
|
"build/hooks",
|
||||||
"node_modules/resin-discoverable-services/services/**/*",
|
"node_modules/resin-discoverable-services/services/**/*",
|
||||||
|
"node_modules/opn-cli/node_modules/opn/xdg-open",
|
||||||
|
"node_modules/open/xdg-open",
|
||||||
"node_modules/windosu/*.bat",
|
"node_modules/windosu/*.bat",
|
||||||
"node_modules/windosu/*.cmd"
|
"node_modules/windosu/*.cmd"
|
||||||
]
|
]
|
||||||
|
15
patches/open+7.0.2.patch
Normal file
15
patches/open+7.0.2.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
diff --git a/node_modules/open/index.js b/node_modules/open/index.js
|
||||||
|
index 5fe49ad..c9194ba 100644
|
||||||
|
--- a/node_modules/open/index.js
|
||||||
|
+++ b/node_modules/open/index.js
|
||||||
|
@@ -10,7 +10,9 @@ const pAccess = promisify(fs.access);
|
||||||
|
const pExecFile = promisify(childProcess.execFile);
|
||||||
|
|
||||||
|
// Path to included `xdg-open`.
|
||||||
|
-const localXdgOpenPath = path.join(__dirname, 'xdg-open');
|
||||||
|
+const localXdgOpenPath = process.pkg
|
||||||
|
+ ? path.join(path.dirname(process.execPath), 'xdg-open')
|
||||||
|
+ : path.join(__dirname, 'xdg-open');
|
||||||
|
|
||||||
|
// Convert a path from WSL format to Windows format:
|
||||||
|
// `/mnt/c/Program Files/Example/MyApp.exe` → `C:\Program Files\Example\MyApp.exe`
|
14
patches/opn-cli++opn+4.0.2.patch
Normal file
14
patches/opn-cli++opn+4.0.2.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
diff --git a/node_modules/opn-cli/node_modules/opn/index.js b/node_modules/opn-cli/node_modules/opn/index.js
|
||||||
|
index 13dcb66..16c5b2a 100644
|
||||||
|
--- a/node_modules/opn-cli/node_modules/opn/index.js
|
||||||
|
+++ b/node_modules/opn-cli/node_modules/opn/index.js
|
||||||
|
@@ -52,6 +52,9 @@ module.exports = function (target, opts) {
|
||||||
|
cmd = opts.app;
|
||||||
|
} else {
|
||||||
|
cmd = path.join(__dirname, 'xdg-open');
|
||||||
|
+ cmd = process.pkg
|
||||||
|
+ ? path.join(path.dirname(process.execPath), 'xdg-open-402')
|
||||||
|
+ : path.join(__dirname, 'xdg-open');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appArgs.length > 0) {
|
Loading…
Reference in New Issue
Block a user