🔧 Update script metadata and improve AI summarization logic with color support check
This commit is contained in:
@@ -126,12 +126,12 @@
|
|||||||
},
|
},
|
||||||
"git-ai-summarize.ts": {
|
"git-ai-summarize.ts": {
|
||||||
"script_name": "git-ai-summarize.ts",
|
"script_name": "git-ai-summarize.ts",
|
||||||
"script_length": 766,
|
"script_length": 951,
|
||||||
"script_sha256": "7eab10eade8daa55c5f831114a1998bd8dc9a4c9d44bc5bd0f13e786b19d34da",
|
"script_sha256": "7a1dd9daa4f23b21acd89131ad42be81bf4800fdb4b1b1c637e92969a74d9e12",
|
||||||
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/git-ai-summarize.ts",
|
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/git-ai-summarize.ts",
|
||||||
"single_script_file": true,
|
"single_script_file": true,
|
||||||
"publish_time": 1775488837668,
|
"publish_time": 1775488837668,
|
||||||
"update_time": 1775488837668
|
"update_time": 1775880777603
|
||||||
},
|
},
|
||||||
"git-check.ts": {
|
"git-check.ts": {
|
||||||
"script_name": "git-check.ts",
|
"script_name": "git-check.ts",
|
||||||
|
|||||||
@@ -1,16 +1,25 @@
|
|||||||
#!/usr/bin/env runts -- --allow-all
|
#!/usr/bin/env runts -- --allow-all
|
||||||
|
|
||||||
import {log, ProcessBar,} from "https://script.hatter.ink/@67/deno-commons-mod.ts";
|
import {
|
||||||
import {summarizeGitStatusDiff} from "https://script.hatter.ink/@0/deno-ai-mod.ts";
|
log,
|
||||||
|
ProcessBar,
|
||||||
|
supportColor,
|
||||||
|
} from "https://script.hatter.ink/@67/deno-commons-mod.ts";
|
||||||
|
import { summarizeGitStatusDiff } from "https://script.hatter.ink/@0/deno-ai-mod.ts";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const summary = await new ProcessBar("AI summarizing").call(
|
if (supportColor()) {
|
||||||
async (): Promise<string> => {
|
const summary = await new ProcessBar("AI summarizing").call(
|
||||||
return await summarizeGitStatusDiff();
|
async (): Promise<string> => {
|
||||||
},
|
return await summarizeGitStatusDiff();
|
||||||
);
|
},
|
||||||
if (summary != null) {
|
);
|
||||||
log.success(`AI summarized git commit message: ${summary}`);
|
if (summary) {
|
||||||
|
log.success(`AI summarized git commit message: ${summary}`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const summary = await summarizeGitStatusDiff();
|
||||||
|
console.log(summary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,5 +28,5 @@ main().catch((err) => {
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
}).then(() => process.exit(0));
|
}).then(() => process.exit(0));
|
||||||
|
|
||||||
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260406T231949+08:00.MEYCIQCvhjoBTNBaFA6ElSS8
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260411T121140+08:00.MEQCICY10pAbrhm7lwIAF7te
|
||||||
// m6XruooQW8iNLQSRt0HObj3t/wIhAJLotqm8Ccdbb0MZTOvbhdQlD1+qS2wx9yrRd9lhi7Op
|
// apYXE5VLvpg9IZgzWOoh+QWdAiB9+jWbpYK5/RtGPk+CdQCNPYpxGT1xjq8J8145PnMlLA==
|
||||||
|
|||||||
Reference in New Issue
Block a user