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 19, 2023
1 parent cbf9600 commit b4d2b55
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/manage-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,18 @@ const runCliProcess = async ({
stdoutIncludes,
stderrIncludes,
resolveErrorAsFalse = false,
ignoreStdout = false,
}: {
command: string;
stdoutIncludes?: string;
stderrIncludes?: string;
resolveErrorAsFalse?: boolean;
ignoreStdout?: boolean;
}) => {
return await new Promise((resolve) => {
exec(command, (error, stdout, stderr) => {
const stdoutClean = stdout.replace(/.*voucherify/, "").trim();
if (
(stdoutIncludes && stdout?.includes(stdoutIncludes)) ||
(!ignoreStdout && !stdoutIncludes && stdout) ||
(stdoutIncludes && stdoutClean?.includes(stdoutIncludes)) ||
(!stdoutIncludes && stdoutClean) ||
(stderrIncludes && stderr.includes(stderrIncludes))
) {
return resolve(true);
Expand Down Expand Up @@ -166,7 +165,6 @@ const uploadOpenApiFile = async (version) => {
await runCliProcess({
command: `rdme openapi ./reference/OpenAPI.json --version=${version} --create`,
stderrIncludes: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.`,
ignoreStdout: true,
});
console.log(colors.green("OPEN API FILE WAS UPLOADED"));
};
Expand Down

0 comments on commit b4d2b55

Please sign in to comment.