Skip to content

Commit

Permalink
Merge branch 'main' into ekzhang/windows-support
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Sep 22, 2024
2 parents 02a3db6 + 426e7c4 commit 5509d66
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-freebsd]
pre-build = [
"apt-get update",
"apt install -y protobuf-compiler",
]
7 changes: 6 additions & 1 deletion crates/sshx/src/terminal/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ pub async fn get_default_shell() -> String {
return shell;
}
}
for shell in ["/bin/bash", "/bin/sh"] {
for shell in [
"/bin/bash",
"/bin/sh",
"/usr/local/bin/bash",
"/usr/local/bin/sh",
] {
if fs::metadata(shell).await.is_ok() {
return shell.to_string();
}
Expand Down
4 changes: 4 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ cargo build --release --target x86_64-apple-darwin
# aarch64-apple-darwin: for macOS on Apple Silicon
cargo build --release --target aarch64-apple-darwin

# x86_64-unknown-freebsd: for FreeBSD
cross build --release --target x86_64-unknown-freebsd

# *-pc-windows-msvc: for Windows, requires cargo-xwin
cargo xwin build -p sshx --release --target x86_64-pc-windows-msvc
cargo xwin build -p sshx --release --target i686-pc-windows-msvc
Expand All @@ -48,6 +51,7 @@ targets=(
armv7-unknown-linux-musleabihf
x86_64-apple-darwin
aarch64-apple-darwin
x86_64-unknown-freebsd
x86_64-pc-windows-msvc
i686-pc-windows-msvc
aarch64-pc-windows-msvc
Expand Down
1 change: 1 addition & 0 deletions static/get
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set +e
case "$(uname -s)" in
Linux*) suffix="-unknown-linux-musl";;
Darwin*) suffix="-apple-darwin";;
FreeBSD*) suffix="-unknown-freebsd";;
MINGW*|MSYS*|CYGWIN*)
echo "You are on Windows. Please visit sshx.io to download the executable.";
exit 1;;
Expand Down

0 comments on commit 5509d66

Please sign in to comment.