This is my personal effort to scripting faster, reliable and scalable with bun.sh and it's $ Shell feature.
- fetch repository
git clone .../shelly-bunny.git && cd shelly-bunny
- install dependencies
bun install
- install executable shortcuts to preferred destination listen in the $PATH environment
bun run . install -d ~/personal-cli
- from any location, trigger the script
tsum -a 1 -b 2
to confirm the functionality
- Create the js/ts file according to available scripts in the ./runners directory.
- The assets directory contains files like
help.txt
used to display help by-h
or--help
options. This file is required. - Export default function, what stand for the script entry point. Add the
minimist
property to the exported entry function as an arguments description proceed by the minimist.
Minimal example:
export default function run() {}
run.minimist = {
boolean: ["help"],
alias: {
h: "help",
},
};
- To confirm there is not issue with the structure, run
bun run . tsum
example script to perform the checks (see below). - Make unit tests and implements the script.
- Run the
bun run full-check
to perform eslint and prettier checks as well as the unit tests.
There are checks to confirm there is not forgotten script, help files are placed and minimist configurations are available. The reason for this is to confirm consistency of the this project and confirm all script are well structured.
All scripts are checked any time any script is triggered. This may be avoided by passing the --no-check
option.
In case of triggering the script via executable shortcut, not any check will be performed (check the assets/install/template.sh
).