Make URL override smarter (thx Adam)
to not crash local PlayWright tests that here might get Electron command-line options. See https://github.com/nativefier/nativefier/pull/1437#issuecomment-1193315259
This commit is contained in:
parent
e12da46064
commit
a4ef7481de
|
@ -85,9 +85,11 @@ if (isWindows()) {
|
|||
app.setAppUserModelId(app.getName());
|
||||
}
|
||||
|
||||
const urlArgv = process.argv.filter((a) => a.startsWith('http'));
|
||||
|
||||
// Take in a URL on the command line as an override
|
||||
if (process.argv.length > 1) {
|
||||
const maybeUrl = process.argv[1];
|
||||
if (urlArgv.length > 0) {
|
||||
const maybeUrl = urlArgv[0];
|
||||
try {
|
||||
new URL(maybeUrl);
|
||||
appArgs.targetUrl = maybeUrl;
|
||||
|
|
Loading…
Reference in New Issue