Skip to content

Commit c35bf3d

Browse files
committed
Prepare versionning
1 parent f2a7348 commit c35bf3d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

manage-ghar

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PID_FILE="runner.pid"
66
LOG_FILE="runner.log"
77
STATE_DIRNAME="state"
88
CONFIG_FILE=".manage_ghar.conf"
9+
VERSION="0.0.0"
910

1011
# check if runner is running based on the existence of a state file and based
1112
# on a valid PID
@@ -103,7 +104,7 @@ usage () {
103104
cat <<EOF
104105
Manage GitHub Actions Runner like a SysV init script
105106
106-
manage-ghar [-s STATE_PATH] [-r RUNNER_COMMAND] [-f] [-h] {start|stop|restart|status} RUNNER_PATH
107+
manage-ghar [-s STATE_PATH] [-r RUNNER_COMMAND] [-f] [-v] [-h] {start|stop|restart|status} RUNNER_PATH
107108
108109
Optional arguments:
109110
-s STATE_PATH
@@ -112,6 +113,8 @@ Optional arguments:
112113
Command to execute instead of running the runner directly. This command should not take any argument.
113114
-f
114115
Force start even if the runner is running.
116+
-v
117+
Show current version and exit.
115118
-h
116119
Show this help message and exit.
117120
@@ -137,6 +140,10 @@ Arguments must be in the form "<key>=<value>".
137140
EOF
138141
}
139142

143+
show_version () {
144+
echo "manage-ghar v$VERSION"
145+
}
146+
140147
main () {
141148
# default arguments
142149
local state_path=""
@@ -150,13 +157,17 @@ main () {
150157
fi
151158

152159
# process optional arguments
153-
while getopts ":hs:r:f" option
160+
while getopts ":hvs:r:f" option
154161
do
155162
case $option in
156163
"h")
157164
usage
158165
exit 0
159166
;;
167+
"v")
168+
show_version
169+
exit 0
170+
;;
160171
"s")
161172
state_path="$OPTARG"
162173
;;

0 commit comments

Comments
 (0)