Browse code

Remove version from bundle path

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Daniel Nephin authored on 2017/08/31 03:45:18
Showing 1 changed files
... ...
@@ -190,20 +190,18 @@ bundle() {
190 190
 }
191 191
 
192 192
 main() {
193
-	# We want this to fail if the bundles already exist and cannot be removed.
194
-	# This is to avoid mixing bundles from different versions of the code.
195
-	mkdir -p bundles
196
-	if [ -e "bundles/$VERSION" ] && [ -z "$KEEPBUNDLE" ]; then
197
-		echo "bundles/$VERSION already exists. Removing."
198
-		rm -fr "bundles/$VERSION" && mkdir "bundles/$VERSION" || exit 1
193
+	if [ -z "${KEEPBUNDLE-}" ]; then
194
+		echo "Removing bundles/"
195
+		rm -rf "bundles/*"
199 196
 		echo
200 197
 	fi
198
+	mkdir -p bundles
201 199
 
200
+	# Windows and symlinks don't get along well
202 201
 	if [ "$(go env GOHOSTOS)" != 'windows' ]; then
203
-		# Windows and symlinks don't get along well
204
-
205 202
 		rm -f bundles/latest
206
-		ln -s "$VERSION" bundles/latest
203
+		# preserve latest symlink for backward compatibility
204
+		ln -sf . bundles/latest
207 205
 	fi
208 206
 
209 207
 	if [ $# -lt 1 ]; then
... ...
@@ -212,7 +210,7 @@ main() {
212 212
 		bundles=($@)
213 213
 	fi
214 214
 	for bundle in ${bundles[@]}; do
215
-		export DEST="bundles/$VERSION/$(basename "$bundle")"
215
+		export DEST="bundles/$(basename "$bundle")"
216 216
 		# Cygdrive paths don't play well with go build -o.
217 217
 		if [[ "$(uname -s)" == CYGWIN* ]]; then
218 218
 			export DEST="$(cygpath -mw "$DEST")"