mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-16 07:46:31 +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 argv = _.attempt(() => {
|
||||||
const entryPoint = getApplicationEntryPoint()
|
let entryPoint = getApplicationEntryPoint()
|
||||||
|
|
||||||
// AppImages run over FUSE, so the files inside the mount point
|
// AppImages run over FUSE, so the files inside the mount point
|
||||||
// can only be accessed by the user that mounted the AppImage.
|
// 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
|
// mount-point, and as a workaround, we re-mount the original
|
||||||
// AppImage as root.
|
// AppImage as root.
|
||||||
if (os.platform() === 'linux' && process.env.APPIMAGE && process.env.APPDIR) {
|
if (os.platform() === 'linux' && process.env.APPIMAGE && process.env.APPDIR) {
|
||||||
|
entryPoint = _.replace(entryPoint, process.env.APPDIR, '')
|
||||||
return [
|
return [
|
||||||
process.env.APPIMAGE,
|
process.env.APPIMAGE,
|
||||||
|
'-e',
|
||||||
// Executing the AppImage with ELECTRON_RUN_AS_NODE opens
|
`require(\`\${process.env.APPDIR}${entryPoint}\`)`
|
||||||
// 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/'), '')
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
_.first(process.argv),
|
_.first(process.argv),
|
||||||
entryPoint
|
entryPoint
|
||||||
|
Loading…
x
Reference in New Issue
Block a user