File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8686
8787# Execute remote installation script
8888log " Fetching and executing official installation script"
89- if ! curl " ${ghAuthHeader[@]} " --proto ' =https ' --tlsv1.3 - fsSL " ${INSTALL_SCRIPT_URL} " | /bin/bash -s -- -b " ${INSTALL_DIR} " " ${VERSION} " ; then
89+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${INSTALL_SCRIPT_URL} " | /bin/bash -s -- -b " ${INSTALL_DIR} " " ${VERSION} " ; then
9090 die " Installation failed. Check version or network connection."
9191fi
9292
Original file line number Diff line number Diff line change 8686
8787# Execute remote installation script
8888log " Fetching and executing official installation script"
89- if ! curl " ${ghAuthHeader[@]} " --proto ' =https ' --tlsv1.3 - fsSL " ${INSTALL_SCRIPT_URL} " | /bin/bash -s -- " ${VERSION} " " ${INSTALL_DIR} " ; then
89+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${INSTALL_SCRIPT_URL} " | /bin/bash -s -- " ${VERSION} " " ${INSTALL_DIR} " ; then
9090 die " Installation failed. Check version or network connection."
9191fi
9292
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ log "Installing ${TOOL_NAME} (${VERSION}) to ${INSTALL_DIR}"
7777
7878# Execute remote installation script
7979log " Fetching and executing official installation script"
80- if ! curl -fsSL --proto ' =https ' --tlsv1.3 " ${INSTALL_SCRIPT_URL} " | /bin/bash -s -- --version " ${VERSION} " --install-folder " ${INSTALL_DIR} " --symlink-folder " ${INSTALL_DIR} " ; then
80+ if ! curl -fsSL " ${INSTALL_SCRIPT_URL} " | /bin/bash -s -- --version " ${VERSION} " --install-folder " ${INSTALL_DIR} " --symlink-folder " ${INSTALL_DIR} " ; then
8181 die " Installation failed. Check version or network connection."
8282fi
8383
Original file line number Diff line number Diff line change 112112fi
113113
114114releaseJson=" ${tempDir} /release.json"
115- if ! curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${apiUrl} " -o " ${releaseJson} " ; then
115+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${apiUrl} " -o " ${releaseJson} " ; then
116116 die " Failed to fetch release information. Check version or network connection."
117117fi
118118
@@ -125,7 +125,7 @@ downloadUrl="$(jq -r --arg arch "${arch}" \
125125
126126log " Downloading ${downloadUrl} "
127127binaryPath=" ${tempDir} /${TOOL_NAME} "
128- curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${downloadUrl} " -o " ${binaryPath} " || die " Download failed"
128+ curl " ${ghAuthHeader[@]} " -fsSL " ${downloadUrl} " -o " ${binaryPath} " || die " Download failed"
129129
130130# Install binary
131131log " Installing binary"
Original file line number Diff line number Diff line change 114114fi
115115
116116releaseJson=" ${tempDir} /release.json"
117- if ! curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${apiUrl} " -o " ${releaseJson} " ; then
117+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${apiUrl} " -o " ${releaseJson} " ; then
118118 die " Failed to fetch release information. Check version or network connection."
119119fi
120120
@@ -127,7 +127,7 @@ downloadUrl="$(jq -r --arg arch "${arch}" \
127127
128128log " Downloading ${downloadUrl} "
129129archivePath=" ${tempDir} /${TOOL_NAME} .tar.gz"
130- curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
130+ curl " ${ghAuthHeader[@]} " -fsSL " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
131131
132132# Extract binary
133133log " Extracting archive"
Original file line number Diff line number Diff line change 8686
8787# Execute remote installation script
8888log " Fetching and executing official installation script"
89- if ! curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${INSTALL_SCRIPT_URL} " | sh -s -- -b " ${INSTALL_DIR} " " ${VERSION} " ; then
89+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${INSTALL_SCRIPT_URL} " | sh -s -- -b " ${INSTALL_DIR} " " ${VERSION} " ; then
9090 die " Installation failed. Check version or network connection."
9191fi
9292
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ log "Installing ${TOOL_NAME} (${VERSION}) for ${os}/${arch} to ${INSTALL_DIR}"
107107
108108# GitHub API authentication
109109ghAuthHeader=(-H " Accept: application/vnd.github+json" )
110+ ghAuthHeader+=(-H " User-Agent: ${TOOL_NAME} -installer" )
110111if [[ -n " ${GITHUB_TOKEN:- } " ]]; then
111112 ghAuthHeader+=(-H " Authorization: Bearer ${GITHUB_TOKEN} " )
112113fi
123124fi
124125
125126releaseJson=" ${tempDir} /release.json"
126- if ! curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${apiUrl} " -o " ${releaseJson} " ; then
127+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${apiUrl} " -o " ${releaseJson} " ; then
127128 die " Failed to fetch release information. Check version or network connection."
128129fi
129130
@@ -136,7 +137,7 @@ downloadUrl="$(jq -r --arg os "${os}" --arg arch "${arch}" \
136137
137138log " Downloading ${downloadUrl} "
138139archivePath=" ${tempDir} /${TOOL_NAME} .tar.gz"
139- curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
140+ curl " ${ghAuthHeader[@]} " -fsSL " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
140141
141142# Extract binary
142143log " Extracting archive"
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ log "Installing ${TOOL_NAME} (${VERSION}) to ${INSTALL_DIR}"
7777
7878# Execute remote installation script
7979log " Fetching and executing official installation script"
80- if ! curl -fsSL --proto ' =https ' --tlsv1.3 " ${INSTALL_SCRIPT_URL} " | sh -s -- --install-method standalone --opentofu-version " ${VERSION} " --install-path " ${INSTALL_DIR} " ; then
80+ if ! curl -fsSL " ${INSTALL_SCRIPT_URL} " | sh -s -- --install-method standalone --opentofu-version " ${VERSION} " --install-path " ${INSTALL_DIR} " ; then
8181 die " Installation failed. Check version or network connection."
8282fi
8383
Original file line number Diff line number Diff line change 110110fi
111111
112112releaseJson=" ${tempDir} /release.json"
113- if ! curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${apiUrl} " -o " ${releaseJson} " ; then
113+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${apiUrl} " -o " ${releaseJson} " ; then
114114 die " Failed to fetch release information. Check version or network connection."
115115fi
116116
@@ -123,7 +123,7 @@ downloadUrl="$(jq -r --arg arch "${arch}" \
123123
124124log " Downloading ${downloadUrl} "
125125archivePath=" ${tempDir} /${TOOL_NAME} .tar.gz"
126- curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
126+ curl " ${ghAuthHeader[@]} " -fsSL " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
127127
128128# Extract binary
129129log " Extracting archive"
Original file line number Diff line number Diff line change 108108fi
109109
110110releaseJson=" ${tempDir} /release.json"
111- if ! curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${apiUrl} " -o " ${releaseJson} " ; then
111+ if ! curl " ${ghAuthHeader[@]} " -fsSL " ${apiUrl} " -o " ${releaseJson} " ; then
112112 die " Failed to fetch release information. Check version or network connection."
113113fi
114114
@@ -121,7 +121,7 @@ downloadUrl="$(jq -r --arg arch "${arch}" \
121121
122122log " Downloading ${downloadUrl} "
123123archivePath=" ${tempDir} /${TOOL_NAME} .tar.xz"
124- curl " ${ghAuthHeader[@]} " -fsSL --proto ' =https ' --tlsv1.3 " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
124+ curl " ${ghAuthHeader[@]} " -fsSL " ${downloadUrl} " -o " ${archivePath} " || die " Download failed"
125125
126126# Extract binary
127127log " Extracting archive"
You can’t perform that action at this time.
0 commit comments