- Simplified command cases by removing unnecessary semicolons.

- Improved error handling in rebuild.nix for clarity and consistency.
This commit is contained in:
2026-05-29 09:29:31 +02:00
parent d989792774
commit 134fc441a5
8 changed files with 435 additions and 447 deletions

View File

@ -1,10 +1,7 @@
# ncli/commands/git.nix — commit, push, pull, status, format
lib:
let
lib: let
inherit (lib) project;
in
{
in {
commit_case = ''
cd "$HOME/${project}" || { echo "Error: Could not change to $HOME/${project}"; exit 1; }
if [ "$#" -lt 2 ]; then
@ -20,29 +17,24 @@ in
fi
git add -A && git commit -m "$commit_msg"
;;
'';
push_case = ''
cd "$HOME/${project}" || { echo "Error: Could not change to $HOME/${project}"; exit 1; }
git push origin $(git branch --show-current)
;;
'';
pull_case = ''
cd "$HOME/${project}" || { echo "Error: Could not change to $HOME/${project}"; exit 1; }
git pull origin $(git branch --show-current)
;;
'';
status_case = ''
cd "$HOME/${project}" || { echo "Error: Could not change to $HOME/${project}"; exit 1; }
git status
;;
'';
format_case = ''
nix fmt .
;;
'';
}