Skip to content

Instantly share code, notes, and snippets.

@mizchi
Last active September 26, 2023 02:15
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizchi/81a9dc03fb407ab7f8baae4564287e9e to your computer and use it in GitHub Desktop.
Save mizchi/81a9dc03fb407ab7f8baae4564287e9e to your computer and use it in GitHub Desktop.
#!/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:zx@7.1.1";
import { parse } from "https://deno.land/std@0.202.0/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