mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-27 20:44:53 +00:00
use last commit date in git-add
This commit is contained in:
parent
f4d64f7b0c
commit
a9852efd0d
@ -3,7 +3,7 @@
|
||||
#
|
||||
# works together with git pre-push.sh and ADD all changed files since last push
|
||||
|
||||
#### $$VERSION$$ v1.2-dev2-23-g8379a62
|
||||
#### $$VERSION$$ v1.2-dev2-64-gf4d64f7
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
@ -14,24 +14,24 @@ else
|
||||
echo "Sorry, no git repository $(pwd)" && exit 1
|
||||
fi
|
||||
|
||||
[ ! -f .git/.lastpush ] && echo "No push or hooks not installed, use \"git add\" instead ... Abort" && exit
|
||||
[ ! -f .git/.lastcommit ] && echo "No previous commit or hooks not installed, use \"git add\" instead ... Abort" && exit
|
||||
|
||||
set +f
|
||||
FILES="$(find ./* -newer .git/.lastpush| grep -v -e 'DIST\/' -e 'STANDALONE\/' -e 'JSON.sh')"
|
||||
set -f
|
||||
# FILES="$(find ./* -newer .git/.lastpush)"
|
||||
[ "${FILES}" = "" ] && echo "Noting changed since last push ... Abort" && exit
|
||||
[ "${FILES}" = "" ] && echo "Noting changed since last commit ..." && exit
|
||||
|
||||
# run pre_commit on files
|
||||
dev/hooks/pre-commit.sh
|
||||
|
||||
echo -n "Add files to repo: "
|
||||
echo -e "Add files to repo: \c"
|
||||
# shellcheck disable=SC2086
|
||||
for file in ${FILES}
|
||||
do
|
||||
[ -d "${file}" ] && continue
|
||||
echo -n "${file} "
|
||||
echo -e "${file} \c"
|
||||
git add "$file"
|
||||
done
|
||||
git add .
|
||||
echo "done."
|
||||
echo " - Done."
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v1.2-dev2-63-g69ca15a
|
||||
#### $$VERSION$$ v1.2-dev2-64-gf4d64f7
|
||||
|
||||
############
|
||||
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# this has to run once atfer git clone
|
||||
# and every time we create new hooks
|
||||
#### $$VERSION$$ v1.2-dev2-63-g69ca15a
|
||||
#### $$VERSION$$ v1.2-dev2-64-gf4d64f7
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
|
Loading…
Reference in New Issue
Block a user