Skip to content

Commit b3acfe1

Browse files
committed
Extend the existing config
1 parent d32a4d1 commit b3acfe1

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/react/utils/token/to-cli.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ export default async (mail, token) => {
77
const fs = remote.require('fs-promise')
88

99
const filePath = path.join(os.homedir(), '.now.json')
10-
11-
try {
12-
await fs.ensureFile(filePath)
13-
} catch (err) {
14-
console.error(err)
15-
return
16-
}
17-
1810
let currentContent = {}
1911

2012
try {
@@ -24,9 +16,11 @@ export default async (mail, token) => {
2416
currentContent.email = mail
2517
currentContent.token = token
2618

19+
const newContent = JSON.stringify(currentContent, null, 2)
20+
2721
try {
28-
await fs.writeJSON(filePath, currentContent)
22+
await fs.writeFile(filePath, newContent)
2923
} catch (err) {
30-
console.error('Could not overwrite .now.json')
24+
console.error(err)
3125
}
3226
}

0 commit comments

Comments
 (0)