mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-09 08:30:15 +00:00
Validation of url should trigger after the check for the required arguments
This commit is contained in:
parent
0939715017
commit
debc395599
15
cli.js
15
cli.js
@ -17,23 +17,24 @@ if (protocolSchemes && protocolNames && protocolNames.length === protocolSchemes
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (!validator.isURL(args.target)) {
|
||||
console.error('Enter a valid target url');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!args.dir || !args.name || !args.version || !args.target || (!args.all && (!args.platform || !args.arch))) {
|
||||
console.error(usage);
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!validator.isURL(args.target)) {
|
||||
console.error('Enter a valid target url');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// writes parameters for the app into a text file
|
||||
// I'm not exactly sure how to pass these as an argument through code
|
||||
var appArgs = {
|
||||
name: args.name,
|
||||
targetUrl: args.target
|
||||
};
|
||||
|
||||
fs.writeFileSync('./app/targetUrl.txt', JSON.stringify(appArgs));
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user