fixed overwriting existing tokens

pull/29/head
tycrek 3 years ago
parent 95349e4b55
commit c10cdc6c50
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -202,11 +202,14 @@ function doSetup() {
.then(() => { .then(() => {
// Make sure auth.json exists and generate the first key // Make sure auth.json exists and generate the first key
let users = {}; if (!fs.existsSync(path('auth.json'))) {
users[token()] = { username: 'ass', count: 0 }; let users = {};
fs.writeJsonSync(path('auth.json'), { users }, { spaces: 4 }); users[token()] = { username: 'ass', count: 0 };
log.debug('File created', 'auth.json') fs.writeJsonSync(path('auth.json'), { users }, { spaces: 4 });
.success('!! Important', `Save this token in a secure spot: ${Object.keys(users)[0]}`) log.debug('File created', 'auth.json')
.success('!! Important', `Save this token in a secure spot: ${Object.keys(users)[0]}`)
.blank();
}
let existingData = {} let existingData = {}
try { try {

Loading…
Cancel
Save