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.
|
See https://github.com/krgamestudios/MERN-template/wiki for help.
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
|
||||||
//determine local computer address for mac user vs everyone else
|
//determine local computer address for mac user vs everyone else
|
||||||
let macQuestion = '';
|
let macUser = '';
|
||||||
while (macQuestion !== true && macQuestion !== false) {
|
while (macUser.toLowerCase() !== 'yes' && macUser.toLowerCase() !== 'no') {
|
||||||
macQuestion = await question('Will the MERN Template be running locally on a MacOS system? (yes or no)', '');
|
macUser = 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const macUser = macQuestion;
|
const localAddress = macUser ? 'localhost' : '%';
|
||||||
|
|
||||||
let localComputerAddress = '%';
|
|
||||||
if (macUser === true) {
|
|
||||||
localComputerAddress = 'localhost';
|
|
||||||
}
|
|
||||||
|
|
||||||
const localAddress = localComputerAddress;
|
|
||||||
|
|
||||||
//project configuration
|
//project configuration
|
||||||
const projectName = await question('Project Name', 'template');
|
const projectName = await question('Project Name', 'template');
|
||||||
|
|||||||
Reference in New Issue
Block a user