Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 777067b

Browse files
author
Jonathan Spruance (Insight Global)
committed
Change function to async await
1 parent a7b78dd commit 777067b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cli/src/hooks/init/inithook.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ const hook: Hook<'init'> = async function (opts) {
4747
// if there's no timestamp in config, create one and check for updates
4848
// if there is a timestamp in config and it's not from today, check for updates
4949
const lastCheck = userConfig.lastVersionCheck ? new Date(userConfig.lastVersionCheck) : null
50-
if (!isToday(lastCheck, curDateTime)) {
51-
await checkForUpdate()
52-
updateUserConfig(curDateTime)
50+
if (!isToday(lastCheck, curDateTime)) {
51+
await checkForUpdate()
52+
updateUserConfig(curDateTime)
5353
}
5454

5555
/* tslint:disable:no-unused */
@@ -78,7 +78,7 @@ const hook: Hook<'init'> = async function (opts) {
7878

7979
await fs.mkdirp(this.config.configDir)
8080

81-
fs.writeFileSync(path.join(this.config.configDir, 'config.json'), JSON.stringify(userConfig, null, 2))
81+
await fs.writeFile(path.join(this.config.configDir, 'config.json'), JSON.stringify(userConfig, null, 2))
8282
}
8383

8484
this.config.pjson.telemetry = userConfig.telemetry

0 commit comments

Comments
 (0)