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

Commit

Permalink
refactor exists for existsSync to fix fs error
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Mar 19, 2024
1 parent 445c51a commit 25a31e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cmd-fns/publish/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { z } from "zod"
import { AppContext } from "../../util/app-context"
import * as Path from "path"
import * as fs from "fs/promises"
import { readFileSync } from "fs"
import { existsSync, readFileSync } from "fs"
import { getAllPackageFiles } from "lib/util/get-all-package-files"
import prompts from "prompts"
import { getGeneratedReadme } from "../init/get-generated-readme"
Expand All @@ -25,7 +25,7 @@ export const publish = async (ctx: AppContext, args: any) => {

const shouldIncrement = params.increment || params.patch

if (!(await fs.exists(Path.join(ctx.cwd, "package.json")))) {
if (!existsSync(Path.join(ctx.cwd, "package.json"))) {
console.log(kleur.red("No package.json found in current directory"))
process.exit(1)
}
Expand Down Expand Up @@ -244,7 +244,7 @@ export const publish = async (ctx: AppContext, args: any) => {
tmpTarballPath
)}`.json()

if (!(await fs.exists(tmpTarballPath))) {
if (!existsSync(tmpTarballPath)) {
console.log(kleur.red(`Couldn't find tarball at ${tmpTarballPath}`))
process.exit(1)
}
Expand Down

0 comments on commit 25a31e7

Please sign in to comment.