Skip to content

Commit

Permalink
fix(GUI): no write after elevation in GNU/Linux (#721)
Browse files Browse the repository at this point in the history
When the application is packaged as an AppImage, we're accidentally not
applying the whitespace escaping routine, causing images that contain
white spaces to cause Etcher to stall and never start the write.

The issue was even harder to debug given that the problem was not
reproducible when running Etcher from `npm start`.

Change-Type: patch
Changelog-Entry: Fix flashing never starting after elevation in GNU/Linux.
Fixes: #631
Fixes: #665
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
Juan Cruz Viotti authored Sep 26, 2016
1 parent 95aaea5 commit 8175174
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/src/child-writer/writer-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ return isElevated().then((elevated) => {
if (process.env.APPIMAGE && process.env.APPDIR) {
const mountPoint = process.env.APPDIR + '-elevated';

// Translate the current arguments to
// point to the new mount location.
const translatedArguments = _.map(process.argv, (argv) => {
return argv.replace(process.env.APPDIR, mountPoint);
});

// We wrap the command with `sh -c` since it seems
// the only way to effectively run many commands
// with a graphical sudo interface,
Expand All @@ -155,13 +161,7 @@ return isElevated().then((elevated) => {
'&&'
]
.concat(commandPrefix)

// Translate the current arguments to
// point to the new mount location.
.concat(_.map(process.argv, (argv) => {
return argv.replace(process.env.APPDIR, mountPoint);
}))

.concat(utils.escapeWhiteSpacesFromArguments(translatedArguments))
.concat([
';',

Expand Down

0 comments on commit 8175174

Please sign in to comment.