1
0
Fork 0
mirror of synced 2024-12-21 22:21:08 -05:00

Add 'yadm add .' option

This commit is contained in:
Rodrigo Campos 2016-03-05 21:36:12 -03:00
parent 4948f1b137
commit dce0f9a2a8

16
yadm
View file

@ -44,7 +44,7 @@ function main() {
#; no argumnts will result in help() #; no argumnts will result in help()
help help
elif [ "$1" = "gitconfig" ] ; then elif [ "$1" = "gitconfig" ] ; then
#; 'config' is used for yadm, need to use 'gitcofnig' to pass through to git #; 'config' is used for yadm, need to use 'gitconfig' to pass through to git
shift shift
git_command config "$@" git_command config "$@"
elif [[ "$1" =~ $internal_commands ]] ; then elif [[ "$1" =~ $internal_commands ]] ; then
@ -87,6 +87,8 @@ function main() {
done done
[ ! -d $YADM_WORK ] && error_out "Work tree does not exist: [$YADM_WORK]" [ ! -d $YADM_WORK ] && error_out "Work tree does not exist: [$YADM_WORK]"
$YADM_COMMAND "$YADM_ARGS" $YADM_COMMAND "$YADM_ARGS"
elif [[ "$@" = "add ." ]] ; then
git_add_all
else else
#; any other commands are simply passed through to git #; any other commands are simply passed through to git
git_command "$@" git_command "$@"
@ -96,6 +98,8 @@ function main() {
auto_alt auto_alt
auto_perms auto_perms
exit 0
} }
#; ****** yadm Commands ****** #; ****** yadm Commands ******
@ -268,6 +272,16 @@ function git_command() {
} }
function git_add_all() {
require_repo
#; add all modified files to staging area
git add $(git status | grep modified | awk '{print $2}')
CHANGES_POSSIBLE=1
}
function help() { function help() {
cat << EOF cat << EOF