-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprepare-release.js
More file actions
32 lines (29 loc) · 905 Bytes
/
prepare-release.js
File metadata and controls
32 lines (29 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { exec } from "node:child_process";
console.log("> git status --porcelain");
exec("git status --porcelain", (err, stdout, stderr) => {
if (err) {
console.error(`Error executing git status: ${stderr}`);
return;
}
if (stdout) {
console.log(" Found changes:", "\n - " + stdout.split("\n").filter(Boolean).join("\n - "));
console.log("> git add .");
exec("git add .", (err, stdout, stderr) => {
if (err) {
console.error(`Error executing git add: ${stderr}`);
return;
}
console.log('> git commit -n -m "prepare-release changes"');
exec('git commit -n -m "prepare-release changes"', (err, stdout, stderr) => {
if (err) {
console.error(`Error executing git commit: ${stderr}`);
return;
} else {
console.log("✅ Changes committed successfully.");
}
});
});
} else {
console.log("✅ No untracked files to commit.");
}
});