Rename more scripts
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
This commit is contained in:
parent
410d0b33c6
commit
469f519890
7 changed files with 16 additions and 14 deletions
|
@ -1,54 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# SCRIPT NAME:
|
||||
# submodule_update
|
||||
#
|
||||
# AUTHOR:
|
||||
# Severin Kaderli <severin.kaderli@gmail.com>
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# Updates the submodules in all Git repositories in this folder and creates a
|
||||
# new commit and pushes it. Only when there are no staged changes pending.
|
||||
#
|
||||
# USAGE:
|
||||
# ./submodule_update
|
||||
. utils
|
||||
|
||||
START_DIR=$(pwd)
|
||||
|
||||
print_header "Updating submodules"
|
||||
|
||||
while IFS= read -r -d '' dir
|
||||
do
|
||||
cd "$dir" || exit 1
|
||||
cd .. || exit 1
|
||||
print_section "Checking $(pwd)"
|
||||
|
||||
if [ -z "$(git status --porcelain)" ]
|
||||
then
|
||||
print_log "No pending changes"
|
||||
print_log "Updating submodules"
|
||||
git pl > /dev/null 2>&1
|
||||
|
||||
# Check if any changes are available
|
||||
if [ -z "$(git status --porcelain)" ]
|
||||
then
|
||||
print_log "No updates found"
|
||||
else
|
||||
print_log "Updates found"
|
||||
print_log "Creating commit"
|
||||
git a > /dev/null 2>&1
|
||||
git c -m "Update submodules" > /dev/null 2>&1
|
||||
print_log "Pushing commit"
|
||||
git p > /dev/null 2>&1
|
||||
print_log "Commit was pushed"
|
||||
fi
|
||||
else
|
||||
print_log "Pending changes. Ignoring"
|
||||
fi
|
||||
|
||||
echo -e ""
|
||||
|
||||
cd "${START_DIR}" || exit 1
|
||||
|
||||
done < <(find . -name .git -type d -prune -print0)
|
Loading…
Add table
Add a link
Reference in a new issue