This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathupdate.sh
executable file
·59 lines (50 loc) · 1.85 KB
/
update.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Be strict about exiting this script if we hit an error.
set -euo pipefail
# Start in the root repo directory.
cd `dirname "${BASH_SOURCE[0]}"`
echo
echo ==============================================================================
echo Updating `pwd` ...
echo ==============================================================================
#echo
#echo ------------------------------------------------------------------------------
#echo Making sure git is configured...
#echo ------------------------------------------------------------------------------
git_email=`git config --get user.email` || true
git_name=`git config --get user.name` || true
#echo git email: $git_email
#echo git name: $git_name
if [ -z "$git_email" ]
then
echo Git user.email unset. Setting to \"[email protected]\"
git config user.email "[email protected]"
fi
if [ -z "$git_name" ]
then
echo Git user.name unset. Setting to \"Someone\"
git config user.name "Someone"
fi
echo
echo ------------------------------------------------------------------------------
echo Local changes:
echo ------------------------------------------------------------------------------
git status
echo
echo ------------------------------------------------------------------------------
echo Stashing any changes...
echo ------------------------------------------------------------------------------
git stash
echo
echo ------------------------------------------------------------------------------
echo Pulling latest changes...
echo ------------------------------------------------------------------------------
git pull
echo
echo ------------------------------------------------------------------------------
echo Finished.
echo ------------------------------------------------------------------------------
echo To get back any stashed changes, run:
echo " git stash apply"
echo from inside the repo directory.
echo