-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit_update.sh
More file actions
executable file
·30 lines (24 loc) · 930 Bytes
/
commit_update.sh
File metadata and controls
executable file
·30 lines (24 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# Step 4: check for changed files and create respective commit messages
# -----------------------------------------------------------------------------
commit_maybe () {
commit_message=$1
shift
file_names=""
for var in "$@"
do
found=$(git diff --name-only --diff-filter=M | grep -c ${var})
if [ "$found" -ge 1 ]; then
file_names="${file_names} ${var}"
fi
done
if [ ! -z "$file_names" ]; then
git commit ${file_names} -m "${commit_message}"
fi
}
# commit new meteor release version
NEW_METEOR_VERSION=$(cat ./.meteor/release | cut -d'@' -f2 )
commit_maybe "meteor core updated to ${NEW_METEOR_VERSION}" .meteor/release .meteor/.finished-upgraders
commit_maybe "meteor packages updated" .meteor/packages .meteor/versions
commit_maybe "npm packages updated" package.json package-lock.json