Last active
September 26, 2023 02:15
-
-
Save mizchi/81a9dc03fb407ab7f8baae4564287e9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S deno run -A | |
/* | |
$ edit ~/bin/cmd | |
$ chmod +x ~/bin/cmd | |
$ cmd -f | |
# Run | |
$ ls -al | |
total 24 | |
drwxr-xr-x 10 kotaro.chikuba staff 320 Sep 22 20:16 . | |
drwxr-xr-x 9 kotaro.chikuba staff 288 Sep 22 20:01 .git | |
-rw-r--r-- 1 kotaro.chikuba staff 8 Sep 22 20:01 .gitignore | |
drwxr-xr-x 3 kotaro.chikuba staff 96 Sep 22 20:15 .vscode | |
drwxr-xr-x 3 kotaro.chikuba staff 96 Sep 22 21:23 deno | |
*/ | |
import { $ } from "npm:[email protected]"; | |
import { parse } from "https://deno.land/[email protected]/flags/mod.ts"; | |
const args = parse(Deno.args, { | |
default: { | |
flag: false, | |
}, | |
alias: { | |
flag: "f", | |
} | |
}); | |
if (args.flag) { | |
await $`ls -al`; | |
} else { | |
await $`ls`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment