Skip to content

Commit 27da6f0

Browse files
committed
fix: Refactor authentication & update config file output format
- Change a typo in authentication prompt: propmt -> prompt - A new variable named newConfig is created to represent the updated configuration object - Remove old url and broadcast properties from newConfig - Use newConfig to generate a new format of the CoCreateConfig object for output file - Reformat JSON.stringify with a null value as the 2nd parameter and 4 spaces indentation as the 3rd parameter
1 parent c86d68d commit 27da6f0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"build": "NODE_ENV=production npx webpack --config webpack.config.js",
3030
"dev": "npx webpack --config webpack.config.js --watch",
3131
"docs": "node ./node_modules/@cocreate/docs/src/index.js",
32-
"postinstall": "node ./node_modules/@cocreate/cli/check-coc.js"
32+
"postinstal": "node ./node_modules/@cocreate/cli/check-coc.js"
3333
},
3434
"repository": {
3535
"type": "git",

src/server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = async function file(CoCreateConfig) {
2424
key: 'host',
2525
prompt: 'Enter the host: '
2626
}, {
27-
propmt: 'Choose an authentication option: \n1.key\n2.Sign In\n',
27+
prompt: 'Choose an authentication option: \n1.key\n2.Sign In\n',
2828
choices: {
2929
'1': {
3030
key: 'key',
@@ -336,9 +336,9 @@ module.exports = async function file(CoCreateConfig) {
336336

337337
newConfig.sources = sources
338338

339-
delete newConfig.config.url
340-
delete newConfig.config.broadcast
341-
const write_str = `module.exports = ${JSON.stringify(globalConfig, null, 4)};`;
339+
delete newConfig.url
340+
delete newConfig.broadcast
341+
const write_str = `module.exports = ${JSON.stringify(newConfig, null, 4)};`;
342342

343343
fs.writeFileSync(configFile, write_str);
344344
}

0 commit comments

Comments
 (0)