-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from chrisdobler/master
Various Updates
- Loading branch information
Showing
6 changed files
with
146 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import {receivedDetails} from './main' | ||
|
||
const readline = require('readline'); | ||
|
||
const prompter = (sayStuff, processIn, defaultAnswer) => { | ||
const rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout, | ||
}); | ||
rl.question(sayStuff, (answer) => { | ||
rl.close(); | ||
if (answer.length < 1 && defaultAnswer) processIn(defaultAnswer); | ||
else if (answer.length < 1) prompter(sayStuff, processIn, defaultAnswer); | ||
else processIn(answer); | ||
}); | ||
}; | ||
|
||
const config = require(process.cwd() + '/.nebulis.json'); | ||
const out = process.stdout; | ||
|
||
const getDetails = (GitName, project) => { | ||
config.owners = []; | ||
config.project = project; | ||
|
||
const owner = {}; | ||
|
||
out.write('\nWelcome to Nebulis Analytics 🔥\n'); | ||
|
||
prompter('\nPlease enter your full name [ex: John Doe]:', (res) => { | ||
owner.fullName = res | ||
prompter('\nWe have detected your github username is ' + GitName + '\nPress enter to confirm [' + GitName + ']:', (res) => { | ||
owner.username = res; | ||
config.owners.push(owner); | ||
checkForNextMember(); | ||
}, GitName); | ||
}); | ||
}; | ||
const checkForNextMember = () => { | ||
prompter('\nDo you have any additional team members? [Y/n]:', (res) => { | ||
if (res === 'Y') { | ||
getNextMember(); | ||
} else if (res === 'n') exit(); | ||
else checkForNextMember(); | ||
}); | ||
} | ||
|
||
const getNextMember = () => { | ||
const owner = {}; | ||
prompter('\nWhat is your team members full name? []:', (res) => { | ||
owner.fullName = res | ||
prompter('\nWhat is your team members github username? []:', (res) => { | ||
owner.username = res; | ||
config.owners.push(owner); | ||
checkForNextMember(); | ||
}); | ||
}); | ||
}; | ||
|
||
const exit = () => { | ||
receivedDetails(config); | ||
} | ||
|
||
export { getDetails as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters