🔧 Update script metadata and refactor howto.ts for improved readability
This commit is contained in:
+3
-3
@@ -153,12 +153,12 @@
|
|||||||
},
|
},
|
||||||
"howto.ts": {
|
"howto.ts": {
|
||||||
"script_name": "howto.ts",
|
"script_name": "howto.ts",
|
||||||
"script_length": 4094,
|
"script_length": 4071,
|
||||||
"script_sha256": "b1c77486ac714c346fea5f3a8df733b142404baee0d9421d6c05de4c765faae3",
|
"script_sha256": "248a5220971d44c8b5fc8c51186abc840cd97e27bba2de065e29b605d6fb80c3",
|
||||||
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/howto.ts",
|
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/howto.ts",
|
||||||
"single_script_file": true,
|
"single_script_file": true,
|
||||||
"publish_time": 1775973075081,
|
"publish_time": 1775973075081,
|
||||||
"update_time": 1776005585038
|
"update_time": 1776005907857
|
||||||
},
|
},
|
||||||
"init-cheatsheet.ts": {
|
"init-cheatsheet.ts": {
|
||||||
"script_name": "init-cheatsheet.ts",
|
"script_name": "init-cheatsheet.ts",
|
||||||
|
|||||||
+6
-12
@@ -1,14 +1,8 @@
|
|||||||
#!/usr/bin/env runts -- --allow-all
|
#!/usr/bin/env runts -- --allow-all
|
||||||
|
|
||||||
import { parseArgs } from "jsr:@std/cli/parse-args";
|
import {parseArgs} from "jsr:@std/cli/parse-args";
|
||||||
import {
|
import {execCommandShell, exit, log, ProcessBar, term,} from "https://script.hatter.ink/@67/deno-commons-mod.ts";
|
||||||
execCommandShell,
|
import {howto} from "https://script.hatter.ink/@2/deno-ai-mod.ts";
|
||||||
exit,
|
|
||||||
log,
|
|
||||||
ProcessBar,
|
|
||||||
term,
|
|
||||||
} from "https://script.hatter.ink/@67/deno-commons-mod.ts";
|
|
||||||
import { howto } from "https://script.hatter.ink/@2/deno-ai-mod.ts";
|
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const flags = parseArgs(Deno.args, {
|
const flags = parseArgs(Deno.args, {
|
||||||
@@ -38,7 +32,7 @@ howto.ts [-N|--no-exec] 'MESSAGE' - generate command line for MESSAGE
|
|||||||
if (!message) {
|
if (!message) {
|
||||||
throw new Error("Message is required");
|
throw new Error("Message is required");
|
||||||
}
|
}
|
||||||
const summary = await new ProcessBar("AI howto").call(
|
const summary = await new ProcessBar("AI thinking").call(
|
||||||
async (): Promise<string> => {
|
async (): Promise<string> => {
|
||||||
return await howto(message);
|
return await howto(message);
|
||||||
},
|
},
|
||||||
@@ -131,5 +125,5 @@ main().catch((err) => {
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
}).then(() => process.exit(0));
|
}).then(() => process.exit(0));
|
||||||
|
|
||||||
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260412T225301+08:00.MEQCIEPTb4Mwqih4QKV7EULz
|
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260412T225825+08:00.MEYCIQDPOL61Uv/EojOmlOVx
|
||||||
// SAoBxv7KfLZjH14w5EQrdOKHAiAkl/cxcehBt/Lot9ZLfYsJQfPSzZKBkDwy/RWjxsjyhQ==
|
// ju3YO2uKeurNj8msZe2MNUm/QwIhAJEhMrgij9sbgpvwrVFPmV0LeZk2zrtRp1+IUvag2OfV
|
||||||
|
|||||||
Reference in New Issue
Block a user