7
7
# curl --silent "https://api.github.com/repos/sfeakes/AqualinkD/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'
8
8
#
9
9
# list latest dev version
10
- # curl --silent "https://raw.githubusercontent.com/sfeakes/AqualinkD/master/version.h" | grep AQUALINKD_VERSION | cut -d '"' -f 2 | tr '\n'
10
+ # curl --silent "https://raw.githubusercontent.com/sfeakes/AqualinkD/master/version.h" | grep AQUALINKD_VERSION | cut -d '"' -f 2
11
11
#
12
12
13
13
@@ -30,6 +30,7 @@ function print_usage {
30
30
echoerr " $0 force_latest <- Force latest option (don't run any version checks)"
31
31
echoerr " $0 install <- Install to local filesystem, (config files will no be overwritten)"
32
32
echoerr " $0 clean <- Remove everything, including configuration files"
33
+ echoerr " $0 <option> downloadonly <- Download using one of above options, but don't unstall"
33
34
echoerr " "
34
35
}
35
36
@@ -65,6 +66,10 @@ function git_release_version {
65
66
echo ` curl --silent " https://api.github.com/repos/sfeakes/AqualinkD/releases/latest" | grep -Po ' "tag_name": "\K.*?(?=")' `
66
67
}
67
68
69
+ function get_development_version {
70
+ echo ` curl --silent " https://raw.githubusercontent.com/sfeakes/AqualinkD/master/version.h" | grep AQUALINKD_VERSION | cut -d ' "' -f 2`
71
+ }
72
+
68
73
function remove {
69
74
# cd ~
70
75
@@ -84,6 +89,7 @@ function isvalid_gitinstall {
84
89
}
85
90
86
91
function development_version_download {
92
+ echo " Upgrading $NAME from $( local_version) to $( get_development_version) "
87
93
if isvalid_gitinstall; then
88
94
update
89
95
else
@@ -148,15 +154,19 @@ function release_version_download {
148
154
# Use this tar instead, it's correct dir structure
149
155
curl --silent -L " https://github.com/sfeakes/AqualinkD/archive/$git_version .tar.gz" | tar xz -C " $BASE "
150
156
151
- ver=$( echo $git_version | sed ' s/^. //' )
157
+ ver=$( echo $git_version | sed ' s/^[^0-9]* //' )
152
158
153
159
if [ -d " $AQUA " ]; then
154
- if [ -L " $AQUA " ]; then
155
- unlink " $AQUA "
156
- else
160
+ if [ -d " $AQUA -$version " ]; then
157
161
mv " $AQUA " " $AQUA -$RANDOM "
162
+ else
163
+ mv " $AQUA " " $AQUA -$version "
158
164
fi
159
165
fi
166
+ if [ -L " $AQUA " ]; then
167
+ unlink " $AQUA "
168
+ fi
169
+
160
170
ln -s " $BASE /AqualinkD-$ver " " $AQUA "
161
171
else
162
172
echo " Local $NAME version $version is latest, not downloading"
@@ -201,7 +211,11 @@ else
201
211
exit ;
202
212
fi
203
213
204
- install
214
+ if [ " $2 " == " downloadonly" ]; then
215
+ echo " No install, download only"
216
+ else
217
+ install
218
+ fi
205
219
206
220
echo " Installed " ` cat $AQUA /version.h | cut -d ' "' -f 2 | tr ' \n' ' ' `
207
221
0 commit comments