Skip to content

Commit

Permalink
Update manage-project.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
p-zielinski committed Oct 20, 2023
1 parent 447d9f3 commit 94eed63
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions scripts/manage-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,7 @@ const main = async ({
create?: boolean;
update?: boolean;
}) => {
if (process.env.README_IO_AUTH?.length < 10) {
console.log(
colors.red("`README_IO_AUTH` was not provided in `.env` file :/")
);
return;
}
const valid = await validateOptions({ help, version, create, update });
if (!valid) {
if (!(await validate({ help, version, create, update }))) {
return;
}
if (create) {
Expand Down Expand Up @@ -330,7 +323,7 @@ const asyncMap = (arr, asyncFn) => {
return Promise.all(arr.map(asyncFn));
};

const validateOptions = async ({
const validate = async ({
help,
version,
create,
Expand All @@ -341,6 +334,12 @@ const validateOptions = async ({
create?: boolean;
update?: boolean;
}) => {
if (process.env.README_IO_AUTH?.length < 10) {
console.log(
colors.red("`README_IO_AUTH` was not provided in `.env` file :/")
);
return;
}
if (help || (!version && !create && !update)) {
printHelp();
return false;
Expand Down

0 comments on commit 94eed63

Please sign in to comment.