update commit.ts
This commit is contained in:
@@ -254,6 +254,14 @@ class ProcessBar {
|
||||
}
|
||||
}
|
||||
|
||||
function red(message: string): string {
|
||||
return `\x1b[31m${message}\x1b[0m`;
|
||||
}
|
||||
|
||||
function green(message: string): string {
|
||||
return `\x1b[32m${message}\x1b[0m`;
|
||||
}
|
||||
|
||||
async function checkRev(): Promise<boolean> {
|
||||
const localRev = await getGitLocalRev();
|
||||
const remoteRev = await new ProcessBar("Checking rev").call(
|
||||
@@ -262,7 +270,7 @@ async function checkRev(): Promise<boolean> {
|
||||
},
|
||||
);
|
||||
if (localRev === remoteRev) {
|
||||
console.log(`Check rev successfully, rev: ${localRev}`);
|
||||
console.log(green(`Check rev successfully, rev: ${localRev}`));
|
||||
} else {
|
||||
throw `Check rev failed, local rev: ${localRev} vs remote rev: ${remoteRev}`;
|
||||
}
|
||||
@@ -321,9 +329,9 @@ async function main() {
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error(`[ERROR] ${err}`);
|
||||
console.error(red(`[ERROR] ${err}`));
|
||||
process.exit(0);
|
||||
}).then(() => process.exit(0));
|
||||
|
||||
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260125T180902+08:00.MEUCIQC7L20KJsSMIVy9E8ce
|
||||
// TebyRlLx2O4rSf3Z4aGSeoXhyAIgB4KQRMs1IJz8wlNJeB3J1uQOso8+o8NzCRsjzDLlr4c=
|
||||
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260128T224430+08:00.MEYCIQCBwZf7i4TLaloGJMI2
|
||||
// 1lEGJACKU3pCRDUTXlU2AY5pVgIhANRpDg85DelQ5jyXlaIIDLQnrm9XRUFEQH/me/daYtTN
|
||||
|
||||
Reference in New Issue
Block a user