Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(installer): support for alpine linux #1512

Merged
merged 4 commits into from Feb 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -107,7 +107,7 @@ jobs:
else
npm publish
fi
- run: npx pkg . --targets linux,macos --out-path ./binaries
- run: npx pkg . --targets linux,macos,alpine --out-path ./binaries
- persist_to_workspace:
root: ./
paths:
Expand Down
10 changes: 9 additions & 1 deletion scripts/install.sh
Expand Up @@ -14,6 +14,14 @@ if [ "$UNAME" = "Darwin" ] ; then
FILENAME="spectral-macos"
elif [ "$UNAME" = "Linux" ] ; then
FILENAME="spectral-linux"
if [ -f /etc/os-release ]; then
# extract the value for KEY named "NAME"
DISTRO=$(sed -n -e 's/^NAME="\?\([^"]*\)"\?$/\1/p' /etc/os-release)
if [ "$DISTRO" = "Alpine Linux" ]; then
echo "Installing on Alpine Linux."
FILENAME="spectral-alpine"
fi
fi
fi

URL="https://github.com/stoplightio/spectral/releases/latest/download/${FILENAME}"
Expand All @@ -32,4 +40,4 @@ else
fi
}

install
install