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

Commit06cf4a1

Browse files
committed
extract as non-root
1 parent4179e7f commit06cf4a1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎install.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -624,20 +624,21 @@ install_standalone() {
624624
# fails we can ignore the error as the -w check will then swap us to sudo.
625625
sh_c mkdir -p"$STANDALONE_INSTALL_PREFIX"2>/dev/null||true
626626

627+
sh_c mkdir -p"$CACHE_DIR/tmp"
628+
if ["$STANDALONE_ARCHIVE_FORMAT"= tar.gz ];then
629+
sh_c tar -C"$CACHE_DIR/tmp" -xzf"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.tar.gz"
630+
else
631+
sh_c unzip -d"$CACHE_DIR/tmp" -o"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.zip"
632+
fi
633+
634+
STANDALONE_BINARY_LOCATION="$STANDALONE_INSTALL_PREFIX/bin/$STANDALONE_BINARY_NAME"
635+
627636
sh_c="sh_c"
628637
if [!-w"$STANDALONE_INSTALL_PREFIX" ];then
629638
sh_c="sudo_sh_c"
630639
fi
631640

632641
"$sh_c" mkdir -p"$STANDALONE_INSTALL_PREFIX/bin"
633-
"$sh_c" mkdir -p"$CACHE_DIR/tmp"
634-
if ["$STANDALONE_ARCHIVE_FORMAT"= tar.gz ];then
635-
"$sh_c" tar -C"$CACHE_DIR/tmp" -xzf"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.tar.gz"
636-
else
637-
"$sh_c" unzip -d"$CACHE_DIR/tmp" -o"$CACHE_DIR/coder_${VERSION}_${OS}_${ARCH}.zip"
638-
fi
639-
640-
STANDALONE_BINARY_LOCATION="$STANDALONE_INSTALL_PREFIX/bin/$STANDALONE_BINARY_NAME"
641642

642643
# Remove the file if it already exists to
643644
# avoid https://github.com/coder/coder/issues/2086
@@ -647,7 +648,9 @@ install_standalone() {
647648

648649
# Copy the binary to the correct location.
649650
"$sh_c" cp"$CACHE_DIR/tmp/coder""$STANDALONE_BINARY_LOCATION"
650-
"$sh_c" rm -rv"$CACHE_DIR/tmp"
651+
652+
# Clean up the extracted files (note, not using sudo: $sh_c -> sh_c).
653+
sh_c rm -rv"$CACHE_DIR/tmp"
651654

652655
echo_standalone_postinstall
653656
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp