mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
fix(GUI): preserve original working directory in dialogs in GNU/Linux (#565)
The `$OWD` environment variable, which stands for "Original Working
Directory" is set in recent AppImageKit versions and equals the
directory from where the AppImage was run.
We set the open dialog default path to this environment variable for
consistency with other GNU/Linux applications.
Change-Type: patch,
Changelog-Entry: Set dialog default directory to the place where the AppImage was run from in GNU/Linux.
See: 1569d6f854
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
e79c03a070
commit
4f49c4c9d0
@ -41,6 +41,16 @@ module.exports = function($q, SupportedFormatsModel) {
|
||||
this.selectImage = () => {
|
||||
return $q((resolve, reject) => {
|
||||
electron.remote.dialog.showOpenDialog({
|
||||
|
||||
// This variable is set when running in GNU/Linux from
|
||||
// inside an AppImage, and represents the working directory
|
||||
// from where the AppImage was run (which might not be the
|
||||
// place where the AppImage is located). `OWD` stands for
|
||||
// "Original Working Directory".
|
||||
//
|
||||
// See: https://github.com/probonopd/AppImageKit/commit/1569d6f8540aa6c2c618dbdb5d6fcbf0003952b7
|
||||
defaultPath: process.env.OWD,
|
||||
|
||||
properties: [
|
||||
'openFile'
|
||||
],
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user