Shortened the code with a ternary
This commit is contained in:
+5
-17
@@ -45,26 +45,14 @@ impelented are:
|
||||
See https://github.com/krgamestudios/MERN-template/wiki for help.
|
||||
`
|
||||
);
|
||||
|
||||
//determine local computer address for mac user vs everyone else
|
||||
let macQuestion = '';
|
||||
while (macQuestion !== true && macQuestion !== false) {
|
||||
macQuestion = await question('Will the MERN Template be running locally on a MacOS system? (yes or no)', '');
|
||||
if (macQuestion.toLowerCase() === 'yes') {
|
||||
macQuestion = true;
|
||||
}
|
||||
else if (macQuestion.toLowerCase() === 'no') {
|
||||
macQuestion = false;
|
||||
}
|
||||
let macUser = '';
|
||||
while (macUser.toLowerCase() !== 'yes' && macUser.toLowerCase() !== 'no') {
|
||||
macUser = await question('Will the MERN Template be running locally on a MacOS system? (yes or no)', '');
|
||||
}
|
||||
|
||||
const macUser = macQuestion;
|
||||
|
||||
let localComputerAddress = '%';
|
||||
if (macUser === true) {
|
||||
localComputerAddress = 'localhost';
|
||||
}
|
||||
|
||||
const localAddress = localComputerAddress;
|
||||
const localAddress = macUser ? 'localhost' : '%';
|
||||
|
||||
//project configuration
|
||||
const projectName = await question('Project Name', 'template');
|
||||
|
||||
Reference in New Issue
Block a user