fix(1718): make --dir work when launching Goose.app (#4642)
This commit is contained in:
@@ -434,9 +434,10 @@ let envToggles: EnvToggles = loadSettings().envToggles;
|
|||||||
|
|
||||||
// Parse command line arguments
|
// Parse command line arguments
|
||||||
const parseArgs = () => {
|
const parseArgs = () => {
|
||||||
const args = process.argv.slice(2); // Remove first two elements (electron and script path)
|
|
||||||
let dirPath = null;
|
let dirPath = null;
|
||||||
|
|
||||||
|
// Remove first two elements in dev mode (electron and script path)
|
||||||
|
const args = !dirPath && app.isPackaged ? process.argv : process.argv.slice(2);
|
||||||
for (let i = 0; i < args.length; i++) {
|
for (let i = 0; i < args.length; i++) {
|
||||||
if (args[i] === '--dir' && i + 1 < args.length) {
|
if (args[i] === '--dir' && i + 1 < args.length) {
|
||||||
dirPath = args[i + 1];
|
dirPath = args[i + 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user