diff --git a/script-meta-v2.json b/script-meta-v2.json index 5c6262e..6e2f288 100644 --- a/script-meta-v2.json +++ b/script-meta-v2.json @@ -44,12 +44,12 @@ }, "commit.ts": { "script_name": "commit.ts", - "script_length": 10033, - "script_sha256": "8e2b7eec88cc824f676613548b8624a6a5d47f2a84560f52923b744b3fd9591e", + "script_length": 10297, + "script_sha256": "d23f8e2b33d4d76ee0b556f52df542d10c062f5676b8d924c05ce9b9fe03889f", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/commit.ts", "single_script_file": true, "publish_time": 1769318306585, - "update_time": 1769318644318 + "update_time": 1769320239166 }, "decode-uri-component.ts": { "script_name": "decode-uri-component.ts", diff --git a/single-scripts/commit.ts b/single-scripts/commit.ts index bf92edf..3ce9ec7 100755 --- a/single-scripts/commit.ts +++ b/single-scripts/commit.ts @@ -308,7 +308,15 @@ async function main() { gitCommitArgs.push("-m"); gitCommitArgs.push(message); - console.log(">>>>>", "Git command: ", ["git", gitCommitArgs]); + if (gitStatus.untracked.length > 0) { + const gitAddArgs = ["add"]; + for (const file of gitStatus.untracked) { + gitAddArgs.push(file); + } + console.log(">>>>>", ["git", gitAddArgs]); + await execCommandShell("git", gitAddArgs); + } + console.log(">>>>>", ["git", gitCommitArgs]); await execCommandShell("git", gitCommitArgs); console.log(">>>>>", ["git", "push"]); await new ProcessBar("Git pushing").call(async (): Promise => { @@ -321,5 +329,5 @@ main().catch((err) => { process.exit(0); }).then(() => process.exit(0)); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260125T132351+08:00.MEQCIGM/e3lHXhvDoj2w1HUz -// b3VNQZ5UcV3rYo2eVhGbeclhAiBYWQ70AqGUUS80RKR4Umqr+D4NSSKHIhujwGngWBbKqw== +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260125T135031+08:00.MEUCIBEze5RIPyQ19vGFgOur +// 3UX23ghubli25a0lskk1ezgKAiEAzNzsLCWJ9DNRUbIrA9nbmO15V5qlQY46AeCal6ywS/w= diff --git a/update-meta.sh b/update-meta.sh new file mode 100755 index 0000000..180aaae --- /dev/null +++ b/update-meta.sh @@ -0,0 +1,3 @@ +./update-meta-v1.rs +./update-meta-v2.rs +