mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-06-03 21:30:47 +00:00
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());
|
app.setAppUserModelId(app.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const urlArgv = process.argv.filter((a) => a.startsWith('http'));
|
||||||
|
|
||||||
// Take in a URL on the command line as an override
|
// Take in a URL on the command line as an override
|
||||||
if (process.argv.length > 1) {
|
if (urlArgv.length > 0) {
|
||||||
const maybeUrl = process.argv[1];
|
const maybeUrl = urlArgv[0];
|
||||||
try {
|
try {
|
||||||
new URL(maybeUrl);
|
new URL(maybeUrl);
|
||||||
appArgs.targetUrl = maybeUrl;
|
appArgs.targetUrl = maybeUrl;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user