Skip to content

Commit

Permalink
Add "save" command
Browse files Browse the repository at this point in the history
Add "save" command which saves the changes to the current
branch as a commit
Add new command "save" to git-elegant-commands
  • Loading branch information
Tatyana Boloban committed Nov 14, 2018
1 parent c5ec4fa commit 7fe5f49
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/git-elegant-commands
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ default() {
echo "clear-local"
echo "configure"
echo "check"
echo "save"
}
8 changes: 8 additions & 0 deletions src/main/git-elegant-save
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e

default(){
boxtee git add --interactive
git elegant check --staged
boxtee git commit
}
3 changes: 2 additions & 1 deletion src/test/git-elegant-commands.bats
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ teardown() {
[ "${lines[8]}" = "clear-local" ]
[ "${lines[9]}" = "configure" ]
[ "${lines[10]}" = "check" ]
[ ${#lines[@]} -eq 11 ]
[ "${lines[11]}" = "save" ]
[ ${#lines[@]} -eq 12 ]
}

@test "'commands': default exit code is 0" {
Expand Down

0 comments on commit 7fe5f49

Please sign in to comment.