- Simplified command cases by removing unnecessary semicolons.
- Improved error handling in rebuild.nix for clarity and consistency.
This commit is contained in:
@ -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 .
|
||||
;;
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user