File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,38 @@ _discover_distro_repo() {
106
106
_check_version_id
107
107
DISTRO_REPO=" openSUSE_Leap_${VERSION_ID} "
108
108
;;
109
- * )
109
+ " " )
110
110
_error " Unable to identify distribution. You may specify one with environment variable DISTRO_REPO"
111
111
_error " Please, report to https://forum.crystal-lang.org/c/help-support/11"
112
112
exit 1
113
113
;;
114
+ * )
115
+ # If there's no dedicated repository for the distro, try to figure out
116
+ # if the distro is apt or rpm based and use a default repository.
117
+ _discover_distro_type
118
+
119
+ case " $DISTRO_TYPE " in
120
+ deb)
121
+ DISTRO_REPO=" Debian_Unstable"
122
+ ;;
123
+ rpm)
124
+ DISTRO_REPO=" RHEL_7"
125
+ ;;
126
+ * )
127
+ _error " Unable to identify distribution type ($ID ). You may specify a repository with the environment variable DISTRO_REPO"
128
+ _error " Please, report to https://forum.crystal-lang.org/c/help-support/11"
129
+ exit 1
130
+ ;;
131
+ esac
114
132
esac
115
133
}
116
134
135
+ _discover_distro_type () {
136
+ DISTRO_TYPE=" "
137
+ [[ $( command -v apt-get) ]] && DISTRO_TYPE=" deb" && return
138
+ [[ $( command -v yum) ]] && DISTRO_TYPE=" rpm" && return
139
+ }
140
+
117
141
if [[ $EUID -ne 0 ]]; then
118
142
_error " This script must be run as root"
119
143
exit 1
149
173
150
174
_install_apt () {
151
175
if [[ -z $( command -v wget & > /dev/null) ]] || [[ -z $( command -v gpg & > /dev/null) ]]; then
176
+ [[ -f /etc/apt/sources.list.d/crystal.list ]] && rm -f /etc/apt/sources.list.d/crystal.list
152
177
apt-get update
153
178
apt-get install -y wget gpg
154
179
fi
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bats
2
+
3
+ @test " Elementary OS stable" {
4
+ ./test-install-on-docker.sh elementary/docker:stable
5
+ }
6
+
7
+ @test " Elementary OS unstable" {
8
+ ./test-install-on-docker.sh elementary/docker:unstable
9
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bats
2
+
3
+ @test " Linux Mint 20" {
4
+ ./test-install-on-docker.sh linuxmintd/mint20-amd64
5
+ }
6
+
7
+ @test " Linux Mint 19" {
8
+ ./test-install-on-docker.sh linuxmintd/mint19-amd64
9
+ }
You can’t perform that action at this time.
0 commit comments