@@ -300,50 +300,14 @@ finalize_permissions() {
300300# ** Utility functions **
301301# ***********************
302302
303- _UTIL_SCRIPT=" /usr/local/bin/archlinux_util.sh"
304- if [ ! -x " $_UTIL_SCRIPT " ]; then
305- (
306- _TMP_DIR=$( mktemp --directory --suffix=arch-devcontainer)
307- echo " :: Downloading release tar..."
308- _TAG_NAME=$( curl --silent " https://api.github.com/repos/bartventer/arch-devcontainer-features/releases/latest" | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/' )
309- _BASE_URL=" https://github.com/bartventer/arch-devcontainer-features/releases/download/$_TAG_NAME "
310- _TARFILE=" arch-devcontainer-features-$_TAG_NAME .tar.gz"
311- curl -sSL -o " $_TMP_DIR /${_TARFILE} " " $_BASE_URL /$_TARFILE "
312- curl -sSL -o " $_TMP_DIR /checksums.txt" " $_BASE_URL /checksums.txt"
313- curl -sSL -o " $_TMP_DIR /checksums.txt.asc" " $_BASE_URL /checksums.txt.asc"
314- echo " OK"
315-
316- echo " :: Importing GPG key..."
317- _REPO_GPG_KEY=A080EEF8607B049ED39BE8F6077F8B92C2B891F9
318- gpg --keyserver keyserver.ubuntu.com --recv-keys " $_REPO_GPG_KEY "
319- echo " OK"
320-
321- echo " :: Verifying checksums signature..."
322- cd " $_TMP_DIR "
323- gpg --verify checksums.txt.asc checksums.txt
324- echo " OK"
325-
326- echo " :: Verifying checksums..."
327- sha256sum -c checksums.txt
328- echo " OK"
329-
330- echo " :: Extracting tar..."
331- tar xzf " $_TMP_DIR /$_TARFILE " -C " $_TMP_DIR "
332- echo " OK"
333-
334- echo " :: Moving scripts..."
335- mv ./scripts/archlinux_util.sh " $_UTIL_SCRIPT "
336- chmod +x " $_UTIL_SCRIPT "
337- echo " OK"
338-
339- # Clean up
340- rm -rf " $_TMP_DIR "
341- )
342- fi
303+ _UTILS_SETUP_SCRIPT=$( mktemp)
304+ curl -sSL -o " $_UTILS_SETUP_SCRIPT " https://raw.githubusercontent.com/bartventer/arch-devcontainer-features/main/scripts/archlinux_util_setup.sh
305+ sh " $_UTILS_SETUP_SCRIPT "
306+ rm -f " $_UTILS_SETUP_SCRIPT "
343307
344308# shellcheck disable=SC1091
345309# shellcheck source=scripts/archlinux_util.sh
346- . " $_UTIL_SCRIPT "
310+ . archlinux_util.sh
347311
348312# Source /etc/os-release to get OS info
349313# shellcheck disable=SC1091
0 commit comments