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

Commit673aef0

Browse files
devm33Copilot
andauthored
Update install.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent6990535 commit673aef0

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

‎install.sh‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,26 @@ echo "Downloading from: $DOWNLOAD_URL"
2929
DOWNLOAD_DIR="${HOME}/.copilot"
3030
mkdir -p"$DOWNLOAD_DIR"
3131

32-
# Download and extract
32+
# Download and extract with error handling
33+
TMP_TARBALL="$(mktemp)"
3334
ifcommand -v curl>/dev/null2>&1;then
34-
curl -fsSL"$DOWNLOAD_URL"| tar -xz -C"$DOWNLOAD_DIR"
35+
curl -fsSL"$DOWNLOAD_URL"-o"$TMP_TARBALL"
3536
elifcommand -v wget>/dev/null2>&1;then
36-
wget -qO-"$DOWNLOAD_URL"| tar -xz -C"$DOWNLOAD_DIR"
37+
wget -qO"$TMP_TARBALL""$DOWNLOAD_URL"
3738
else
38-
echo"Error: Neither curl nor wget found. Please install one of them.">&2
39+
echo"Error: Neither curl nor wget found. Please install one of them."
3940
exit 1
4041
fi
4142

43+
# Check that the file is a valid tarball
44+
if! tar -tzf"$TMP_TARBALL">/dev/null2>&1;then
45+
echo"Error: Downloaded file is not a valid tarball or is corrupted."
46+
rm -f"$TMP_TARBALL"
47+
exit 1
48+
fi
49+
50+
tar -xz -C"$DOWNLOAD_DIR" -f"$TMP_TARBALL"
51+
rm -f"$TMP_TARBALL"
4252
if ["$(id -u2>/dev/null||echo 1)"-eq 0 ];then
4353
PREFIX="${PREFIX:-/usr/local}"
4454
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp