Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Commit

Permalink
Fix file existence checks in init.js (#73)
Browse files Browse the repository at this point in the history
* Revert to existsSync

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
  • Loading branch information
astarinmymind and rekmarks authored Jan 25, 2021
1 parent 35a5d98 commit 0c2f1fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/init.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

const { promises: fs } = require('fs');
const { promises: fs, existsSync } = require('fs');
const pathUtils = require('path');
const packageInit = require('init-package-json');

Expand Down Expand Up @@ -68,7 +67,7 @@ module.exports = async function initHandler(argv) {
async function asyncPackageInit() {

// use existing package.json if found
const hasPackage = await fs.access('package.json');
const hasPackage = existsSync('package.json');

if (hasPackage) {

Expand All @@ -90,7 +89,7 @@ async function asyncPackageInit() {
}

// exit if yarn.lock is found, or we'll be in trouble
const usesYarn = await fs.access('yarn.lock');
const usesYarn = existsSync('yarn.lock');

if (usesYarn) {
logError(
Expand Down

0 comments on commit 0c2f1fb

Please sign in to comment.