Skip to content

Commit

Permalink
Added commandline processing for "*" arg
Browse files Browse the repository at this point in the history
  • Loading branch information
N129BZ committed Aug 13, 2024
1 parent e49850c commit 58eccd8
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions make.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,33 +86,38 @@ let isifrchart = false;
/**
* Chart processing starts here
*/
let passedargs = false;
let passedarg = false;
let resp = "";
let parray = [];
let nm = 0;

let arg = process.argv.slice(2);

if (arg.length >= 1) {
passedargs = true;
nm = Number(arg[0]);
console.log(`Processing chart number ${nm}`);
resp = "1";
parray.push(nm - 1);
passedarg = true;
if (arg[0] === "*") {
resp = arg[0];
}
else {
nm = Number(arg[0]);
console.log(`Processing chart number ${nm}`);
resp = "1";
parray.push(nm - 1);
}
}
else {
resp = prompt("Press Enter to process all full charts in the chartprocessindexes array \n\rEnter 1 to process a single VFR chart \n\rEnter * to process all 53 area charts individually: ");
}

if (resp.length > 0 && resp !== "0" ) {
if (resp === "*") {
if (passedarg && resp === "*") {
console.log("\nProcessing all 53 chart areas...\n");
for (var i = 0; i < 53; i++) {
parray.push(i);
}
}
else {
if (passedargs === false) {
if (passedarg === false) {
let lst = "\nSelect the chart number you want to process from this list\n\n";
for (var i = 0; i < settings.vfrindividualcharts.length; i++) {
lst += `${settings.vfrindividualcharts[i][0]} ${settings.vfrindividualcharts[i][1]}\n`;
Expand Down

0 comments on commit 58eccd8

Please sign in to comment.