FS#74034 - [electron] Launcher: Give options from electron-flags before "$@"

Attached to Project: Community Packages
Opened by Mynacol (mynacol) - Saturday, 05 March 2022, 10:31 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Sunday, 21 August 2022, 12:28 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Bruno Pagani (ArchangeGabriel)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Option flags from ~/.config/electron-flags.conf are nice to change electron's behavior.
Unfortunately, this breaks if an electron application is launched with `--` as parameter, e.g. `electron /usr/lib/element/app.asar --`, as the double dash marks the end of electron options.
This is caused by appending any flags in electron-flags.conf at the end instead of the beginning of the electron parameters.
I propose to add them at the beginning, as they should only affect electron options, nothing application-specific.

This might break for some people, but is a better way going forward IMO.
This is also in line with the electron help:
```
$ electron -h
Usage: electron [options] [path]
[...]
```

In the launcher script:
```
-exec /usr/lib/${name}/electron "$@" "${flags[@]}"
+exec /usr/lib/${name}/electron "${flags[@]}" "$@"
```
Additional Info:
- electron 17.1.0-1 (but any prior electron version does this)
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Sunday, 21 August 2022, 12:28 GMT
Reason for closing:  Implemented
Additional comments about closing:  Done in all currently available electrons (and this will be kept for future ones).

Loading...