From a6b1f08442249f05ea82ab9da2ec254b3032662a Mon Sep 17 00:00:00 2001 From: Christian Flamm Date: Thu, 20 Jul 2017 15:59:17 +0200 Subject: [PATCH] add version support --- .travis.yml | 1 + afpre | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 37a556a..c589708 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ before_install: - rvm install 1.9.3 - gem install --no-ri --no-rdoc fpm script: + - sed -i "s/VERSION_PLACEHOLDER/${TRAVIS_TAG}/g" afpre - fpm -v ${TRAVIS_TAG} -n afpre -a all -t deb -d jq -d bash -d openssl -d curl --description "CLI for the AWS Federation Proxy" --url "https://github.com/leflamm/afpre" --license "Apache License 2.0" -s dir afpre=/usr/bin/afpre - fpm -v ${TRAVIS_TAG} -n afpre -a all -t rpm -d jq -d bash -d openssl -d curl -d which --description "CLI for the AWS Federation Proxy" --url "https://github.com/leflamm/afpre" --license "Apache License 2.0" -s dir afpre=/usr/bin/afpre deploy: diff --git a/afpre b/afpre index 65f4c92..8cd868f 100755 --- a/afpre +++ b/afpre @@ -1,4 +1,5 @@ #!/bin/bash +VERSION=VERSION_PLACEHOLDER set -e @@ -41,6 +42,11 @@ options_contain() { grep -q -- "${1}" <<< "${@:2}" } +do_version() { + echo $VERSION + exit 0 +} + do_help() { ! read -d '' HELP <