diff --git a/.devcontainer/postCreateScript.sh b/.devcontainer/postCreateScript.sh index da1b16a..0479237 100755 --- a/.devcontainer/postCreateScript.sh +++ b/.devcontainer/postCreateScript.sh @@ -35,18 +35,21 @@ readonly ALIAS_SRC_URL="https://raw.githubusercontent.com/gvatsal60/Linux-Aliase ################################################################################################### # Functions ################################################################################################### +curl_https() { + if ! command -v curl >/dev/null 2>&1; then + echo "Error: curl is not installed. Aborting." >&2 + return 1 + fi + curl -fsSL --proto '=https' "$@" +} + ################################################################################################### # Main Script ################################################################################################### # Install Linux aliases from external script using curl and execute immediately # Note: Make sure to review scripts fetched from external sources for security reasons -if command -v curl >/dev/null 2>&1; then - curl -fsSL "${ALIAS_SRC_URL}" | sh -else - echo "Error: curl is not installed. Unable to use Linux aliases" - exit 1 -fi +curl_https "${ALIAS_SRC_URL}" | sh # As bind mounts not supported in GitHub Codespaces if [ -n "${CODESPACE_NAME}" ]; then