update term color

This commit is contained in:
2026-02-08 15:56:03 +08:00
parent 4428a5e3fc
commit 052ac6612b
2 changed files with 23 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env runts -- --allow-import
#!/usr/bin/env runts -- --allow-import --allow-net
import {term} from "https://script.hatter.ink/@33/deno-commons-mod.ts";
import { term } from "https://script.hatter.ink/@33/deno-commons-mod.ts";
import { fetchDataWithTimeout } from "../libraries/deno-commons-mod.ts";
function printColors(colors: string[], prefix: string, suffix: string) {
const termOutputs: string[] = [];
@@ -25,6 +26,21 @@ async function main() {
"cyan",
"white",
];
try {
const denoCommonsModResponse = await fetchDataWithTimeout(
"https://hatter.ink/s/deno-commons-mod.ts",
);
const denoCommonsMod = await denoCommonsModResponse.json();
const denoCommonsModUrl = denoCommonsMod.data["script-url"];
console.log(
term.auto(
`[bg_white][green][bold]import {term} from "${denoCommonsModUrl}";\n`,
),
);
} catch (e) {
// IGNORE
}
printColors(colors, "", "");
console.log();
printColors(colors, "", "_bright");
@@ -46,5 +62,5 @@ async function main() {
}
await main();
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260208T154653+08:00.MEUCIQCt2qj/3lPKwhX8n5ID
// jvkItXyST6mG1/j3fcUHybaePQIgAM4ErXInKntZU3DvmuX8szEFXIcFN1W3+zYLzPuYywk=
// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260208T155509+08:00.MEUCIEkRx6ftytYOS1NOOi/C
// 5k1uznr7juyMmOMq/11nkyWIAiEA8tGnRCDfOyaQriwMSjxfO4tTm2xfxbcUbvJfmy/HAso=