Skip to content

Commit

Permalink
Update install.sh (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Jan 18, 2023
1 parent 3c793b7 commit 40d877a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ jobs:
- name: Deploy to www.crystal-lang.org
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'crystal-lang'
run: |
make fetch_install.sh
aws s3 sync ./_site s3://crystal-website --delete
./scripts/set-legacy-url-redirects.bash crystal-website < ./_data/legacy_non_pretty_urls.txt
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ deps: Gemfile.lock
Gemfile.lock: Gemfile
bundle install

.PHONY: fetch_install.sh
fetch_install.sh: ## Fetch install.sh from distribution-scripts repository
wget -N https://raw.githubusercontent.com/crystal-lang/distribution-scripts/master/packages/scripts/install.sh

.PHONY: update_sponsors
update_sponsors: scripts/merge.cr fetch_opencollective ## Update sponsor data (fetch from opencollective and merge into _data/sponsors.csv)
crystal $<
Expand Down
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ _discover_distro_repo() {
;;
opensuse-leap)
_check_version_id
DISTRO_REPO="openSUSE_Leap_${VERSION_ID}"
DISTRO_REPO="${VERSION_ID}"
;;
"")
_error "Unable to identify distribution. You may specify one with environment variable DISTRO_REPO"
Expand Down Expand Up @@ -189,7 +189,7 @@ if [[ -z "${DISTRO_REPO}" ]]; then
fi

_install_apt() {
if [[ -z $(command -v wget &> /dev/null) ]] || [[ -z $(command -v gpg &> /dev/null) ]]; then
if ! command -v wget &> /dev/null || ! command -v gpg &> /dev/null; then
[[ -f /etc/apt/sources.list.d/crystal.list ]] && rm -f /etc/apt/sources.list.d/crystal.list
apt-get update
apt-get install -y wget gpg
Expand Down Expand Up @@ -244,7 +244,7 @@ _install_dnf() {
}

_install_zypper() {
if [[ -z $(command -v curl &> /dev/null) ]]; then
if ! command -v curl &> /dev/null; then
zypper refresh
zypper install -y curl
fi
Expand Down Expand Up @@ -277,7 +277,7 @@ case $DISTRO_REPO in
CentOS*)
_install_yum
;;
openSUSE*)
15.* | openSUSE*)
_install_zypper
;;
*)
Expand Down

0 comments on commit 40d877a

Please sign in to comment.