Skip to content

Commit 25259c3

Browse files
committed
fix: refactor and enhance API and testing infrastructure
- Update DRONE_SSH_VERSION from 1.7.7 to 1.8.0 - Add missing case statement terminator in detect_client_info function Signed-off-by: appleboy <[email protected]>
1 parent bf84378 commit 25259c3

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

entrypoint.sh

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export GITHUB="true"
88

99
GITHUB_ACTION_PATH="${GITHUB_ACTION_PATH%/}"
1010
DRONE_SSH_RELEASE_URL="${DRONE_SSH_RELEASE_URL:-https://github.com/appleboy/drone-ssh/releases/download}"
11-
DRONE_SSH_VERSION="${DRONE_SSH_VERSION:-1.7.7}"
11+
DRONE_SSH_VERSION="${DRONE_SSH_VERSION:-1.8.0}"
1212

1313
function detect_client_info() {
1414
if [ -n "${SSH_CLIENT_OS-}" ]; then
@@ -17,20 +17,21 @@ function detect_client_info() {
1717
local kernel
1818
kernel="$(uname -s)"
1919
case "${kernel}" in
20-
Darwin)
21-
CLIENT_PLATFORM="darwin"
22-
;;
23-
Linux)
24-
CLIENT_PLATFORM="linux"
25-
;;
26-
Windows)
27-
CLIENT_PLATFORM="windows"
28-
;;
29-
*)
30-
echo "Unknown, unsupported platform: ${kernel}." >&2
31-
echo "Supported platforms: Linux, Darwin and Windows." >&2
32-
echo "Bailing out." >&2
33-
exit 2
20+
Darwin)
21+
CLIENT_PLATFORM="darwin"
22+
;;
23+
Linux)
24+
CLIENT_PLATFORM="linux"
25+
;;
26+
Windows)
27+
CLIENT_PLATFORM="windows"
28+
;;
29+
*)
30+
echo "Unknown, unsupported platform: ${kernel}." >&2
31+
echo "Supported platforms: Linux, Darwin and Windows." >&2
32+
echo "Bailing out." >&2
33+
exit 2
34+
;;
3435
esac
3536
fi
3637

@@ -40,18 +41,18 @@ function detect_client_info() {
4041
local machine
4142
machine="$(uname -m)"
4243
case "${machine}" in
43-
x86_64*|i?86_64*|amd64*)
44-
CLIENT_ARCH="amd64"
45-
;;
46-
aarch64*|arm64*)
47-
CLIENT_ARCH="arm64"
48-
;;
49-
*)
50-
echo "Unknown, unsupported architecture (${machine})." >&2
51-
echo "Supported architectures x86_64, i686, arm64." >&2
52-
echo "Bailing out." >&2
53-
exit 3
54-
;;
44+
x86_64* | i?86_64* | amd64*)
45+
CLIENT_ARCH="amd64"
46+
;;
47+
aarch64* | arm64*)
48+
CLIENT_ARCH="arm64"
49+
;;
50+
*)
51+
echo "Unknown, unsupported architecture (${machine})." >&2
52+
echo "Supported architectures x86_64, i686, arm64." >&2
53+
echo "Bailing out." >&2
54+
exit 3
55+
;;
5556
esac
5657
fi
5758
}

0 commit comments

Comments
 (0)