feat(lib): shell: +check-tool
This commit is contained in:
@@ -48,7 +48,10 @@ in {
|
||||
forSystems = systems: nixpkgs.lib.genAttrs systems;
|
||||
forAllSystems = nixpkgs.lib.genAttrs commonSystems;
|
||||
|
||||
shellModules.logs = builtins.readFile ./shell/logs.sh;
|
||||
shellModules = {
|
||||
logs = builtins.readFile ./shell/logs.sh;
|
||||
check-tool = builtins.readFile ./shell/check-tool.sh;
|
||||
};
|
||||
|
||||
sharedShellAliases = {
|
||||
jc = ''journalctl'';
|
||||
|
||||
6
lib/shell/check-tool.sh
Normal file
6
lib/shell/check-tool.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
check_tool() {
|
||||
if ! command -v "$1" >/dev/null; then
|
||||
echo "Required tool \`$2\` are not installed or binary \`$1\` not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user