Skip to content

Commit

Permalink
REF: refactoring util folder
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaMajmudar committed Sep 30, 2024
1 parent 5bf5e59 commit bff8923
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cli/lib/util/app-context.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { AxiosInstance } from "axios"
import Configstore from "configstore"
import { ContextConfigProps } from "cli/lib/create-config-manager"

export type AppContext = {
args: any
args: {
cmd: string[]
yes: boolean
help: boolean | undefined
}
cwd: string
cmd: string[]
params: Record<string, any>
Expand Down
4 changes: 2 additions & 2 deletions cli/lib/util/get-all-package-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const ensureNodeModulesIgnored = async () => {
if (!gitignore.includes("node_modules/")) {
await fs.appendFile(gitignorePath, "\nnode_modules/\n")
}
} catch (err: any) {
if (err.code === "ENOENT") {
} catch (err) {
if ((err as NodeJS.ErrnoException).code === "ENOENT") {
await fs.writeFile(gitignorePath, "node_modules/\n")
} else {
console.error("Error while updating .gitignore:", err)
Expand Down

0 comments on commit bff8923

Please sign in to comment.