bshchk - a dependency checker for bash scripts
these instructions are suited for UNIX systems.
if you are on windows, idk good luck i guess
there are a few ways:
manually, from a git repo
first, clone the damn thing: git clone https://git.blek.codes/blek/bshchk.git
then cd
to that directory and compile it with build.sh
. copy the binary to one of your $PATH
directories
from a package manager
bshchk
is not currently available on any package manager
bshchk
supports the following comment tags:
# to add one or a bunch of CMDs to dependencies
#bshchk:add-cmd cmd1 cmd2
#bshchk:add-cmd cmd
# to exclude one or a bunch of CMDs from dependencies
#bshchk:ignore-cmd cmd1 cmd2
#bshchk:ignore-cmd cmd
also, bshchk
requires for the script to have #!/bin/bash
or #!/usr/bin/env bash
as the first line.
if you really need, there is a CLI Option --ignore-shebang
to ignore an invalid shebang, although it is not recommended.
will print the dependencies as a JSON array, like this: ["one", "two", "three"]
. would be useful when you want to handle the dependencies yourself
add this flag to add deps
variable to your script with an array of dependencies
change the deps
variable name to your liking
(not recommended) if you want to use any other shebang than #!/bin/bash
or #!/usr/bin/env bash