This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,22 +240,23 @@ download_with_progress() {
240240
241241download_and_install () {
242242 print_message info " \n${MUTED} Installing ${NC} opencode ${MUTED} version: ${NC} $specific_version "
243- mkdir -p opencodetmp && cd opencodetmp
243+ local tmp_dir=" ${TMPDIR:-/ tmp} /opencode_install_$$ "
244+ mkdir -p " $tmp_dir "
244245
245- if [[ " $os " == " windows" ]] || ! download_with_progress " $url " " $filename " ; then
246+ if [[ " $os " == " windows" ]] || ! download_with_progress " $url " " $tmp_dir / $ filename" ; then
246247 # Fallback to standard curl on Windows or if custom progress fails
247- curl -# -L -o " $filename " " $url "
248+ curl -# -L -o " $tmp_dir / $ filename" " $url "
248249 fi
249250
250251 if [ " $os " = " linux" ]; then
251- tar -xzf " $filename "
252+ tar -xzf " $tmp_dir / $ filename" -C " $tmp_dir "
252253 else
253- unzip -q " $filename "
254+ unzip -q " $tmp_dir / $ filename" -d " $tmp_dir "
254255 fi
255256
256- mv opencode " $INSTALL_DIR "
257+ mv " $tmp_dir / opencode" " $INSTALL_DIR "
257258 chmod 755 " ${INSTALL_DIR} /opencode"
258- cd .. && rm -rf opencodetmp
259+ rm -rf " $tmp_dir "
259260}
260261
261262check_version
You can’t perform that action at this time.
0 commit comments