-
Notifications
You must be signed in to change notification settings - Fork 464
/
git_all_beams_to_head.sh
executable file
·47 lines (35 loc) · 1.18 KB
/
git_all_beams_to_head.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
#!/bin/bash
fWelcome() {
clear
echo "======================================================="
echo " _ _ _ _ _ _____ _ _______ _ _______ "
echo "| || || | | | (_____) | | (_______) | (_______)"
echo "| || || | |__ | | _ \ \ _ | | _____ "
echo "| ||_|| | __)| | | | \ \| | | | | ___) "
echo "| |___| | | | |_| |_ _____) ) |_____| |_____| |_____ "
echo " \______|_| |_(_____|______/ \______)_______)_______)"
echo " - - - Signaling the start of next generation telephony"
echo "======================================================="
echo
}
fCheckoutBeam() {
echo "# git checkout HEAD $1"
git checkout HEAD $1
return $?
}
fConfirm() {
read -p "This will revert all beams to the HEAD versions. Are you sure you want to do this(y/N)? " -n 1
for confirm in y Y yes YES Yes; do
[ "${REPLY}" == "${confirm}" ] && echo && return 0
done
echo
return 1
}
cd `dirname $0`
fWelcome
fConfirm || exit 1
while read beam; do
fCheckoutBeam $beam || exit 1
done < <(find ../ -name "*.beam")
echo "All erlang beam files reverted to HEAD versions."
exit 0