Skip to content

Commit

Permalink
Change sync fs-extra functions to async functions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcoker committed Nov 20, 2020
1 parent f42a010 commit ca2cb3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/project-generator.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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;
Expand All @@ -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();

Expand Down

0 comments on commit ca2cb3b

Please sign in to comment.