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>
This commit is contained in:
Tianon Gravi 2015-04-03 02:07:57 -06:00
parent a3a45a6ec0
commit d42753485b
1 changed files with 6 additions and 0 deletions

View File

@ -255,6 +255,12 @@ main() {
rm -fr bundles/$VERSION && mkdir bundles/$VERSION || exit 1
echo
fi
if [ "$(go env GOHOSTOS)" != 'windows' ]; then
# Windows and symlinks don't get along well
ln -sfT $VERSION bundles/latest
fi
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $# -lt 1 ]; then
bundles=(${DEFAULT_BUNDLES[@]})