forked from wasmerio/wasmer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
794b78d
commit e7f7c12
Showing
3 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/sh | ||
|
||
initArch() { | ||
ARCH=$(uname -m) | ||
if [ -n "$WASMER_ARCH" ]; then | ||
ARCH="$WASMER_ARCH" | ||
fi | ||
case $ARCH in | ||
amd64) ARCH="amd64";; | ||
x86_64) ARCH="amd64";; | ||
i386) ARCH="386";; | ||
*) echo "Architecture ${ARCH} is not supported by this installation script"; exit 1;; | ||
esac | ||
} | ||
|
||
initOS() { | ||
OS=$(uname | tr '[:upper:]' '[:lower:]') | ||
if [ -n "$WASMER_OS" ]; then | ||
echo "Using WASMER_OS" | ||
OS="$WASMER_OS" | ||
fi | ||
case "$OS" in | ||
darwin) OS='darwin';; | ||
linux) OS='linux';; | ||
freebsd) OS='freebsd';; | ||
mingw*) OS='windows';; | ||
msys*) OS='windows';; | ||
*) echo "OS ${OS} is not supported by this installation script"; exit 1;; | ||
esac | ||
} | ||
|
||
# identify platform based on uname output | ||
initArch | ||
initOS | ||
|
||
# determine install directory if required | ||
BINARY="wasmer-${OS}-${ARCH}" | ||
|
||
# add .exe if on windows | ||
if [ "$OS" = "windows" ]; then | ||
BINARY="$BINARY.exe" | ||
fi | ||
|
||
echo "${BINARY}" |