mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
Merge pull request #2688 from balena-io/fix-appimage
Use APPDIR from env in the child writer
This commit is contained in:
commit
00c94c8efd
@ -206,7 +206,7 @@ exports.performWrite = (image, drives, onProgress) => {
|
||||
})
|
||||
|
||||
const argv = _.attempt(() => {
|
||||
const entryPoint = getApplicationEntryPoint()
|
||||
let entryPoint = getApplicationEntryPoint()
|
||||
|
||||
// AppImages run over FUSE, so the files inside the mount point
|
||||
// can only be accessed by the user that mounted the AppImage.
|
||||
@ -214,18 +214,13 @@ exports.performWrite = (image, drives, onProgress) => {
|
||||
// mount-point, and as a workaround, we re-mount the original
|
||||
// AppImage as root.
|
||||
if (os.platform() === 'linux' && process.env.APPIMAGE && process.env.APPDIR) {
|
||||
entryPoint = _.replace(entryPoint, process.env.APPDIR, '')
|
||||
return [
|
||||
process.env.APPIMAGE,
|
||||
|
||||
// Executing the AppImage with ELECTRON_RUN_AS_NODE opens
|
||||
// the Node.js REPL without loading the default entry point.
|
||||
// As a workaround, we can pass the path to the file we want
|
||||
// to load, relative to the usr/ directory of the mounted
|
||||
// AppImage.
|
||||
_.replace(entryPoint, path.join(process.env.APPDIR, 'usr/'), '')
|
||||
'-e',
|
||||
`require(\`\${process.env.APPDIR}${entryPoint}\`)`
|
||||
]
|
||||
}
|
||||
|
||||
return [
|
||||
_.first(process.argv),
|
||||
entryPoint
|
||||
|
Loading…
x
Reference in New Issue
Block a user