Skip to content

Commit 9816ddb

Browse files
committed
Fix README description for the settings auth data
1 parent 95e438b commit 9816ddb

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,16 @@ If you are planning to allow this script to create your Github repositories, is
8484
5. Open Terminal and add the Github token.
8585

8686
```
87-
# nano ~/create-nodejs-project.json
88-
89-
{
90-
"github": [
91-
{
92-
"user": "YOUR_USER",
93-
"token": "YOUR_TOKEN"
94-
},
95-
{
96-
"user": "OTHER_USER",
97-
"token": "OTHER_TOKEN"
98-
}
99-
]
100-
}
87+
# nano /YOUR-NODE_MODULES-PATH/create-nodejs-project/create-nodejs-settings.json
88+
89+
...
90+
...
91+
"githubAuth": {
92+
"user": "YOUR_USER",
93+
"token": "YOUR_TOKEN"
94+
}
95+
...
96+
...
10197
```
10298

10399

scripts/install.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ const settings = require('../src/settings');
99
let user;
1010
await settings.load();
1111

12+
const authFileAnswers = await questions.promptSettingsFile(settings.settingsPath);
13+
settings.settingsPath = authFileAnswers.settingsPath;
14+
1215
try {
1316
user = await settings.firstUser();
1417
} catch (e) {
1518
// console.log('fixme');
1619
}
1720

21+
1822
const authUser = await questions.promptGithubUser(user.user || '');
1923
const authToken = await questions.promptAuthToken(user.user || '', user.token || '');
2024

@@ -24,5 +28,5 @@ const settings = require('../src/settings');
2428
};
2529

2630
await settings.update();
27-
console.log('File created with your github details');
31+
console.log(`Your settings file was updated on ${settings.settingsPath}`);
2832
})();

src/questionnaire/questions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ async function promptSettingsFile(settingsPath) {
133133
{
134134
type: 'input',
135135
name: 'settingsPath',
136-
message: 'What is the path for the create-nodejs-project.json file?',
136+
message: 'What is the path for the create-nodejs-settings.json file?',
137137
default: settingsPath,
138138
validate: (ans) => {
139139
const path = utils.files.resolvePath(ans);
140140
if (path && fs.existsSync(path)) {
141141
return true;
142142
}
143-
return 'You should introduce a real path for the create-nodejs-project.json';
143+
return 'You should introduce a real path for the create-nodejs-settings.json';
144144
},
145145
},
146146
]);

0 commit comments

Comments
 (0)