feat(lib): shell: +check-tool

This commit is contained in:
2025-07-17 16:22:31 +00:00
parent f32ff17cea
commit 52930f2bd6
2 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -48,7 +48,10 @@ in {
forSystems = systems: nixpkgs.lib.genAttrs systems; forSystems = systems: nixpkgs.lib.genAttrs systems;
forAllSystems = nixpkgs.lib.genAttrs commonSystems; 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 = { sharedShellAliases = {
jc = ''journalctl''; jc = ''journalctl'';
+6
View 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
}