Skip to content

Commit

Permalink
Updated exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
th-mailosaur committed Jul 9, 2024
1 parent 1575278 commit 2f5d9a4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/helpers/checkIfInstalled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function checkIfInstalled(library: Libraries) {
stdio: 'ignore',
});

child.on('close', (code) => {
child.on('close', code => {
if (code !== 0) {
console.log(
pc.red(
Expand Down Expand Up @@ -79,5 +79,5 @@ function handleSpecificLibraryError({
break;
}

return exit(1);
return exit(0);
}
2 changes: 1 addition & 1 deletion src/helpers/isFolderEmpty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export async function isFolderEmpty({ root }: IsFolderEmptyProps) {

if (files.length > 0) {
console.error(`${pc.red(pc.bold('\nRoot folder must be empty'))}`);
exit(1);
exit(0);
}
}
2 changes: 1 addition & 1 deletion src/helpers/isWriteable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export async function isWriteable({ root }: IsWriteableProps) {
console.error(
`${pc.red(pc.bold('\nYou dont have permission to write to this folder'))}`
);
exit(1);
exit(0);
}
}
6 changes: 3 additions & 3 deletions src/inputs/getProjectPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export async function getProjectPath(projectName: string): Promise<string> {
)} because of npm naming restrictions:`
);

validation.errors.forEach((p) =>
validation.errors.forEach(p =>
console.error(`${pc.red(pc.bold('*'))} ${p}`)
);

exit(1);
exit(0);
}

const resolvedProjectPath = path.resolve(projectName);
Expand All @@ -31,7 +31,7 @@ export async function getProjectPath(projectName: string): Promise<string> {

if (folderExists) {
console.error(`${pc.red(pc.bold('\nFolder already exists'))}`);
exit(1);
exit(0);
}

//! ADD THIS BACK WHEN NOT LOCALLY TESTING
Expand Down

0 comments on commit 2f5d9a4

Please sign in to comment.