Skip to content

Commit 7ca9ed8

Browse files
committed
bash/bootstrap.sh: Only download env tarball after Python is installed
Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 7b130e1 commit 7ca9ed8

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

bash/bootstrap.sh

+17-17
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,6 @@ is_available() {
88
command -v "$1" >/dev/null 2>&1
99
}
1010

11-
if is_available curl; then
12-
dwnld_cmd="curl -LSs"
13-
elif is_available wget; then
14-
dwnld_cmd="wget -q -O-"
15-
else
16-
echo "[-] No suitable download command could be found!" >&2
17-
exit 1
18-
fi
19-
20-
$dwnld_cmd https://github.com/nathanchance/env/tarball/main | tar -C "$tmp_dir" -xvzf - --strip-components=1
21-
22-
python_setup=$tmp_dir/python/setup
23-
if [ ! -d "$python_setup" ]; then
24-
echo "[-] $python_setup could not be found, did download command fail?" >&2
25-
exit 1
26-
fi
27-
2811
for file in /etc/os-release /usr/lib/os-release; do
2912
# We don't care if this fails, we will fail on the next command
3013
if . $file >/dev/null 2>&1; then
@@ -42,4 +25,21 @@ if ! is_available python3; then
4225
fi
4326
fi
4427

28+
if is_available curl; then
29+
dwnld_cmd="curl -LSs"
30+
elif is_available wget; then
31+
dwnld_cmd="wget -q -O-"
32+
else
33+
echo "[-] No suitable download command could be found!" >&2
34+
exit 1
35+
fi
36+
37+
$dwnld_cmd https://github.com/nathanchance/env/tarball/main | tar -C "$tmp_dir" -xvzf - --strip-components=1
38+
39+
python_setup=$tmp_dir/python/setup
40+
if [ ! -d "$python_setup" ]; then
41+
echo "[-] $python_setup could not be found, did download command fail?" >&2
42+
exit 1
43+
fi
44+
4545
"$python_setup"/"${ID_LIKE-$ID}".py "$@"

0 commit comments

Comments
 (0)