Skip to content

Commit 9f29b8d

Browse files
committed
Adapt instance manage to support Linux
The command `open` is specific to MacOS. Linux desktops use `xdg-open` instead. The rest of the script should be compatible with Linux. [#801] Signed-off-by: Aitor Perez Cedres <[email protected]>
1 parent aecf155 commit 9f29b8d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bin/kubectl-rabbitmq

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
set -euo pipefail
1212

13+
PLATFORM="$(uname)"
1314
NAMESPACE=""
1415

1516
instance=""
@@ -164,9 +165,16 @@ manage() {
164165
MGMT_PORT=15672
165166
MGMT_URL="http://localhost:$MGMT_PORT/"
166167
fi
168+
169+
if [[ "${PLATFORM}" == "Darwin" ]]; then
170+
OPEN="open"
171+
else
172+
OPEN="xdg-open"
173+
fi
174+
167175
(
168176
sleep 2
169-
open "$MGMT_URL"
177+
$OPEN "$MGMT_URL"
170178
) &
171179
kubectl ${NAMESPACE} port-forward "service/${service}" $MGMT_PORT
172180
}

0 commit comments

Comments
 (0)