Browse code

Add "bundles/latest" symlink

This is a symlink to the latest "bundle" that was assembled. For example, if `VERSION` is currently `1.5.0-dev`, then `bundles/latest` will be a symlink to `bundles/1.5.0-dev` after an attempted build.

One interesting property of this is that after a successful `binary` build, we can `./bundles/latest/binary/docker -v` and get back something like `Docker version 1.5.0-dev, build 3ff6723-dirty`.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>

Tianon Gravi authored on 2015/04/03 17:07:57
Showing 1 changed files
... ...
@@ -255,6 +255,12 @@ main() {
255 255
 		rm -fr bundles/$VERSION && mkdir bundles/$VERSION || exit 1
256 256
 		echo
257 257
 	fi
258
+
259
+	if [ "$(go env GOHOSTOS)" != 'windows' ]; then
260
+		# Windows and symlinks don't get along well
261
+		ln -sfT $VERSION bundles/latest
262
+	fi
263
+
258 264
 	SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
259 265
 	if [ $# -lt 1 ]; then
260 266
 		bundles=(${DEFAULT_BUNDLES[@]})