From ca2cb3bb0d09875b718182acd2b2f724c069bc60 Mon Sep 17 00:00:00 2001 From: Daniel Coker <36392491+danielcoker@users.noreply.github.com> Date: Fri, 20 Nov 2020 11:20:48 +0100 Subject: [PATCH] Change sync fs-extra functions to async functions --- src/libs/project-generator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/project-generator.ts b/src/libs/project-generator.ts index 7713a69..5ba12bb 100644 --- a/src/libs/project-generator.ts +++ b/src/libs/project-generator.ts @@ -1,7 +1,7 @@ import spawn from 'cross-spawn'; import * as path from 'path'; import { existsSync, mkdirSync } from 'fs'; -import { readJsonSync, writeJsonSync, readFile, outputFile } from 'fs-extra'; +import { readJson, writeJson, readFile, outputFile } from 'fs-extra'; import chalk from 'chalk'; import { log } from './display'; @@ -45,7 +45,7 @@ export class ProjectGenerator { const updatingPackageSpinner = log.spinner(log.withBrand('Updating package.json')).start(); try { - const pkg = readJsonSync(packageFile); + const pkg = await readJson(packageFile); pkg.name = this.options.name; pkg.repository.type = undefined; @@ -56,7 +56,7 @@ export class ProjectGenerator { pkg.bugs = undefined; pkg.homepage = undefined; - await writeJsonSync(packageFile, pkg, { spaces: 2 }); + await writeJson(packageFile, pkg, { spaces: 2 }); updatingPackageSpinner.succeed();