Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb06452e

Browse files
authored
fix(install.sh): remove extracted files after installation (#12879)
1 parent7c0fac9 commitb06452e

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎install.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -639,19 +639,21 @@ install_standalone() {
639639
# fails we can ignore the error as the -w check will then swap us to sudo.
640640
sh_c mkdir -p"$STANDALONE_INSTALL_PREFIX"2>/dev/null||true
641641

642+
sh_c mkdir -p"$CACHE_DIR/tmp"
643+
if ["$STANDALONE_ARCHIVE_FORMAT"= tar.gz ];then
644+
sh_c tar -C"$CACHE_DIR/tmp" -xzf"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.tar.gz"
645+
else
646+
sh_c unzip -d"$CACHE_DIR/tmp" -o"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.zip"
647+
fi
648+
649+
STANDALONE_BINARY_LOCATION="$STANDALONE_INSTALL_PREFIX/bin/$STANDALONE_BINARY_NAME"
650+
642651
sh_c="sh_c"
643652
if [!-w"$STANDALONE_INSTALL_PREFIX" ];then
644653
sh_c="sudo_sh_c"
645654
fi
646655

647656
"$sh_c" mkdir -p"$STANDALONE_INSTALL_PREFIX/bin"
648-
if ["$STANDALONE_ARCHIVE_FORMAT"= tar.gz ];then
649-
"$sh_c" tar -C"$CACHE_DIR" -xzf"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.tar.gz"
650-
else
651-
"$sh_c" unzip -d"$CACHE_DIR" -o"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.zip"
652-
fi
653-
654-
STANDALONE_BINARY_LOCATION="$STANDALONE_INSTALL_PREFIX/bin/$STANDALONE_BINARY_NAME"
655657

656658
# Remove the file if it already exists to
657659
# avoid https://github.com/coder/coder/issues/2086
@@ -660,7 +662,10 @@ install_standalone() {
660662
fi
661663

662664
# Copy the binary to the correct location.
663-
"$sh_c" cp"$CACHE_DIR/coder""$STANDALONE_BINARY_LOCATION"
665+
"$sh_c" cp"$CACHE_DIR/tmp/coder""$STANDALONE_BINARY_LOCATION"
666+
667+
# Clean up the extracted files (note, not using sudo: $sh_c -> sh_c).
668+
sh_c rm -rv"$CACHE_DIR/tmp"
664669

665670
echo_standalone_postinstall
666671
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp