Skip to content

Commit 62faa53

Browse files
committed
Redirect error messages to stderr
1 parent 2cd94ad commit 62faa53

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

manage-ghar

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ start () {
4040
# check if the runner path exists
4141
if ! [[ -d "$runner_path" ]]
4242
then
43-
echo "Runner path not found"
43+
echo "Runner path not found" >&2
4444
return 10
4545
fi
4646

4747
# check if the runner is running
4848
if ! $force && is_running "$state_path"
4949
then
50-
echo "The runner is already running"
50+
echo "The runner is already running" >&2
5151
return 11
5252
fi
5353

@@ -63,7 +63,7 @@ start () {
6363
# check if runner command is valid
6464
if ! ([[ -x "$runner_command" ]] || type "$runner_command" >/dev/null 2>&1)
6565
then
66-
echo "Runner command $runner_command is invalid"
66+
echo "Runner command $runner_command is invalid" >&2
6767
return 12
6868
fi
6969

@@ -192,7 +192,7 @@ main () {
192192
force=true
193193
;;
194194
*)
195-
echo "Unknown option $OPTARG"
195+
echo "Unknown option $OPTARG" >&2
196196
usage
197197
return 1
198198
;;
@@ -203,7 +203,7 @@ main () {
203203
# process mandatory arguments
204204
if [[ -z "${1+_}" ]] || [[ -z "${2+_}" ]]
205205
then
206-
echo "Missing arguments"
206+
echo "Missing arguments" >&2
207207
usage
208208
return 2
209209
fi
@@ -243,7 +243,7 @@ main () {
243243
return 0
244244
;;
245245
*)
246-
echo "Unknown subcommand $subcommand"
246+
echo "Unknown subcommand $subcommand" >&2
247247
usage
248248
return 3
249249
;;

0 commit comments

Comments
 (0)