forked from tommytomatoe/Android-Utility
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchange_log
More file actions
executable file
·177 lines (158 loc) · 3.16 KB
/
change_log
File metadata and controls
executable file
·177 lines (158 loc) · 3.16 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#! /bin/bash
# Change Log Creator
# Author: Tommy Nguyen [tommytomatoe]
# Idea: Xclusive Rydah
# Version: 1.0.1
# Date: July 14, 2011
# Contact: tommytomatoe@gmail.com
##functions
#enter
enter()
{ echo
echo "Please press [enter] to continue";
read -s -n 1 key
if [[ $key = "" ]]; then
echo
clear
fi
}
#future features
ff ()
{ clear
echo "Feature coming in a future release. Stay tuned."
enter
}
#load
load_dot ()
{ for DOT in . . . . . . . ; do
echo -n "$DOT"
sleep .15
done
echo "."
}
new_log ()
{
echo -n "Please type a name for your log
(ie. changelog, Rosie.txt, change-log.txt): "
read CHANGE
echo
echo "Your new change-log will be called: $CHANGE"
touch $w/log/$CHANGE
load_dot
echo "$CHANGE has been created in android-utility/log"
echo
echo "Please type corresponding answers to prompts, followed by [enter] key"
echo
prompted
}
prompted ()
{
echo -n "Title for change-log [ie. Rosie Project Changes]: "
read TITLE
echo
echo -n "Author of project [ie. John Smith]: "
read AUTHOR
echo
echo -n "Version number for project [ie. v1.0.2]: "
read NUM
echo
echo -n "Date [ie. July 14, 2011]: "
read DAT
echo
echo "Is the following information correct? [Y/n]"
echo
echo "# $TITLE
# Author: $AUTHOR
# Version: $NUM
# Date: $DAT"
echo
read -s -n 1 yes
case $yes in
y|Y) do_log;;
n|N) prompted;;
*) do_log;;
esac
enter
}
do_log ()
{
echo "# $TITLE
# Author: $AUTHOR
# Version: $NUM
# Date: $DAT" >> $w/log/$CHANGE
echo "
### Update. `date +"%B %d, %Y"`
" >> $w/log/$CHANGE
add_change1
}
add_change1 ()
{
echo "Please type a change to add to your change log:"
echo
echo -n "> "
read ADD
echo $ADD >> $w/log/$CHANGE
add_change2
}
add_change2 ()
{
echo
echo "1. Add more changes [default]"
echo "2. Be done"
read -s -n 1 Q
case $Q in
1) echo; add_change1;;
2) gedit $w/log/$CHANGE; exit;;
*) echo; add_change1;;
esac
}
edit_log ()
{
cd $x
echo "Here are your current logs:"
echo
ls | grep -vE '(build_log|decode_log)'
echo
echo -n "Type name of log you would like to edit: "
read CHANGE
echo
echo "Your current Log:"
sleep .5
echo
cat $w/log/$CHANGE | more
echo
echo "
### Update. `date +"%B %d, %Y"`
" >> $w/log/$CHANGE
add_change1
enter
}
w=$HOME/android-utility/
x=$w/log/$CHANGE
clear
echo "------------------------------"
echo "This is the Change-Log Creator"
echo "------------------------------------------------------------------------"
echo "a tool for devs to create a simple Change-log for their current project."
echo "------------------------------------------------------------------------"
echo "Props go to Xclusive Rydah for the idea"
echo "---------------------------------------"
echo
echo "|-------------------------------|"
echo "|-------------------------------|"
echo "| |"
echo "| 1. Create New Change-Log |"
echo "| 2. Modify Existing Log |"
echo "| |"
echo "|-------------------------------|"
echo "| q. Go to main menu |"
echo "|-------------------------------|"
echo "|-------------------------------|"
printf %s " Select an Option: "
read num
case $num in
1) clear; new_log; change_log;;
2) clear; edit_log;;
q) clear; exit;;
*) echo; echo "$num is not a valid option"; enter;
esac