Commit e344ba9e authored by Nicolai Grymer's avatar Nicolai Grymer 🐤
Browse files

updating port selection

parent 32fddb09
......@@ -34,7 +34,10 @@ function setupFile() {
askForInfo('Please enter the name of the port used for Arduino:', (data) => {
if(data === 'exit\n'){
process.exit();
} else {
} else if(data.trim() === ""){
log(`Port needs to have a name`);
setupFile();
} else {
const path = data.replace(/(\r\n|\n|\r)/gm, "");
log('Port set to: ' + path);
writeFile('settings.txt', {port: path}, readFile);
......@@ -85,6 +88,8 @@ function portError(err){
askForInfo('Hit Enter to try again',readFile);
} else {
log(err);
log("Could not open Serial Port!");
setupFile();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment