File tree Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2+ ADC_VERSION=" v0.2.0"
3+ ADC_LAST_COMMIT=" afc07f1824d883268d9e9d007c63ad3fd6e04de3"
24USER_CONFIG=" $HOME /.appdynamics/adc/config.sh"
35GLOBAL_CONFIG=" /etc/appdynamics/adc/config.sh"
46CONFIG_CONTROLLER_COOKIE_LOCATION=" /tmp/appdynamics-controller-cookie.txt"
@@ -300,6 +302,13 @@ function _help {
300302 fi
301303}
302304register _help Display the global usage information
305+ function _version {
306+ COMMAND_RESULT=" $ADC_VERSION ~ $ADC_LAST_COMMIT "
307+ }
308+ register _config Print the current version of $SCRIPTNAME
309+ describe _config << EOF
310+ Print the current version of $SCRIPTNAME
311+ EOF
303312CONTROLLER_LOGIN_STATUS=0
304313function controller_login {
305314 debug " Login at $CONFIG_CONTROLLER_HOST with $CONFIG_CONTROLLER_CREDENTIALS "
Original file line number Diff line number Diff line change 11#! /bin/bash
2-
2+ LATEST_RELEASE=` git tag | tail -n 1`
3+ LATEST_COMMIT=` git rev-parse HEAD`
34awk '
45 $1 == "source" {system("tail -n +2 " $2); next}
56 {print}
6- ' main.sh | sed ' /^\s*$/d' > adc.sh
7+ ' main.sh | sed ' /^\s*$/d' \
8+ | sed " s/ADC_VERSION=\" vx.y.z\" /ADC_VERSION=\" $LATEST_RELEASE \" /" \
9+ | sed " s/ADC_LAST_COMMIT=\" xxxxxxxxxx\" /ADC_LAST_COMMIT=\" $LATEST_COMMIT \" /" > adc.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ function _version {
4+ COMMAND_RESULT=" $ADC_VERSION ~ $ADC_LAST_COMMIT "
5+ }
6+
7+ register _config Print the current version of $SCRIPTNAME
8+ describe _config << EOF
9+ Print the current version of $SCRIPTNAME
10+ EOF
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ ADC_VERSION=" vx.y.z"
3+ ADC_LAST_COMMIT=" xxxxxxxxxx"
24USER_CONFIG=" $HOME /.appdynamics/adc/config.sh"
35GLOBAL_CONFIG=" /etc/appdynamics/adc/config.sh"
46
@@ -44,6 +46,7 @@ source ./helpers/apiCall.sh
4446
4547source ./commands/config.sh
4648source ./commands/help.sh
49+ source ./commands/version.sh
4750
4851source ./commands/controller/login.sh
4952source ./commands/controller/call.sh
You can’t perform that action at this time.
0 commit comments