File tree Expand file tree Collapse file tree 1 file changed +33
-34
lines changed
Expand file tree Collapse file tree 1 file changed +33
-34
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,40 @@ elif test -d /usr -a ! -w /usr; then
1414 SUDO=" sudo"
1515fi
1616
17+ _is_ci () {
18+ [ -n " $CI " ] && [ $CI != 0 ]
19+ }
20+
1721_install_pre_reqs () {
22+ if _is_ci; then
23+ apt () {
24+ # we should use apt-get not apt in CI
25+ # weird shit ref: https://askubuntu.com/a/668859
26+ export DEBIAN_FRONTEND=noninteractive
27+ cmd=$1
28+ shift
29+ $SUDO apt-get $cmd -qq -o=Dpkg::Use-Pty=0 $@
30+ }
31+ else
32+ echo " ensure you have the ` pkgx` pre-requisites installed:" >&2
33+ apt () {
34+ case " $1 " in
35+ update)
36+ echo >&2
37+ ;;
38+ install)
39+ echo " apt-get" " $@ " >&2
40+ ;;
41+ esac
42+ }
43+ yum () {
44+ echo " yum" " $@ " >&2
45+ }
46+ pacman () {
47+ echo " pacman" " $@ " >&2
48+ }
49+ fi
50+
1851 if test -f /etc/debian_version; then
1952 apt update --yes
2053
@@ -45,10 +78,6 @@ _install_pre_reqs() {
4578 fi
4679}
4780
48- _is_ci () {
49- [ -n " $CI " ] && [ $CI != 0 ]
50- }
51-
5281_install_pkgx () {
5382 if _is_ci; then
5483 progress=" --no-progress-meter"
@@ -123,36 +152,6 @@ elif [ $# -eq 0 ]; then
123152 echo " $( pkgx --version) already installed" >&2
124153fi
125154
126- if _is_ci; then
127- apt () {
128- # we should use apt-get not apt in CI
129- # weird shit ref: https://askubuntu.com/a/668859
130- export DEBIAN_FRONTEND=noninteractive
131- cmd=$1
132- shift
133- $SUDO apt-get $cmd -qq -o=Dpkg::Use-Pty=0 $@
134- }
135- else
136- apt () {
137- case " $1 " in
138- update)
139- echo " ensure you have the ` pkgx` pre-requisites installed:" >&2
140- echo >&2
141- ;;
142- install)
143- echo " apt-get" " $@ " >&2
144- ;;
145- esac
146- }
147- yum () {
148- echo " yum" " $@ " >&2
149- }
150- pacman () {
151- echo " pacman" " $@ " >&2
152- }
153- unset SUDO
154- fi
155-
156155_install_pre_reqs
157156
158157if [ $# -gt 0 ]; then
You can’t perform that action at this time.
0 commit comments