mirror of
https://github.com/swc-project/swc.git
synced 2024-11-27 13:38:33 +03:00
fix(ci): Wait exec asynchronously (#5547)
This commit is contained in:
parent
a090c787cf
commit
719444c42c
@ -1,6 +1,9 @@
|
||||
import { exec } from "child_process";
|
||||
import { getTitleOfLatestCommit } from "../util/git";
|
||||
import { parsePrComments } from "./comment-parser";
|
||||
import { promisify } from "util";
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
|
||||
(async () => {
|
||||
const latestCommitMessage = await getTitleOfLatestCommit();
|
||||
@ -33,9 +36,9 @@ import { parsePrComments } from "./comment-parser";
|
||||
console.log(action);
|
||||
|
||||
if (action.breaking) {
|
||||
await exec(`cargo mono bump ${action.crate} --breaking`);
|
||||
await execAsync(`cargo mono bump ${action.crate} --breaking`);
|
||||
} else {
|
||||
await exec(`cargo mono bump ${action.crate}`);
|
||||
await execAsync(`cargo mono bump ${action.crate}`);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
@ -4,6 +4,8 @@ import * as fs from "fs";
|
||||
import { promisify } from "util";
|
||||
import * as path from "path";
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
|
||||
const writeFile = promisify(fs.writeFile);
|
||||
|
||||
(async () => {
|
||||
@ -21,6 +23,6 @@ pub(crate) static GIT_SHA: &str = "${sha}";`,
|
||||
);
|
||||
|
||||
// we won't push, it's only to avoid dirty check for the publish
|
||||
exec(`git add ${filePath}`);
|
||||
exec(`git commit -m build(swc/core): bump sha`);
|
||||
await execAsync(`git add ${filePath}`);
|
||||
await execAsync(`git commit -m build(swc/core): bump sha`);
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user