Skip to content

Commit

Permalink
Merge pull request #151 from killjoy1221/fix/shell-helper
Browse files Browse the repository at this point in the history
Fix the plugn shell dev helper on linux
  • Loading branch information
josegonzalez authored May 19, 2024
2 parents 6053c71 + ccb96d5 commit b3e7e14
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion plugn
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
#!/bin/bash
exec "$(dirname $BASH_SOURCE)/build/$(uname | awk '{print tolower($0)}')/plugn" "$@"
set -eu
os_name=$(uname)
os_name=${os_name,,}

bin_suffix=""

if [[ "$os_name" == "linux" ]]; then
# TODO: Apple M2?
os_arch="$(uname -m)"
case "$os_arch" in
x86_64)
bin_suffix="-amd64"
;;
arm64 | aarch64)
bin_suffix="-arm64"
;;
*)
echo "Unsupported CPU architecture: $os_arch" >&2 && exit 1
;;
esac
fi

exec "$(dirname "${BASH_SOURCE[0]}")/build/${os_name}/plugn${bin_suffix}" "$@"

0 comments on commit b3e7e14

Please sign in to comment.