1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 13:58:08 +00:00
_/zx/tasks.md
2025-01-28 10:59:17 +09:00

623 B

実行方法

$ deno -A npm:zx tasks.md [task]
: or
$ npm i -g zx
$ zx tasks.md [task]
const task = {
  build,
  test,
  cowsay,
}[argv._[0]];

await (task ?? help)();

build

ビルド

async function build() {
  console.log("building...");
}

test

テスト

async function test() {
  console.log("testing...");
}

cowsay

import { say } from "cowsay";

async function cowsay() {
  console.log(say({ text: argv._[1] ?? "Hello, World!" }));
}

help

このテキストの表示

async function help() {
  await $`cat ${__filename} >&2`;
}