-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed based on coderabbit suggestions
- Loading branch information
Showing
2 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# Automatically download https://www.urbanophile.com/arenn/hacking/gzrt/gzrt-0.8.tar.gz, unpack, and cd into the unpacked folder | ||
# Exit on error | ||
set -e | ||
|
||
if [ -z "$PREFIX" ]; then | ||
echo "PREFIX environment variable not set" | ||
exit 1 | ||
fi | ||
|
||
export CFLAGS="$CFLAGS -I$PREFIX/include" | ||
export LDFLAGS="$LDFLAGS -L$PREFIX/lib" | ||
|
||
make | ||
chmod +x gzrecover | ||
# Clean any previous builds | ||
make clean || true | ||
|
||
if ! make; then | ||
echo "Build failed" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f gzrecover ]; then | ||
echo "Build did not produce gzrecover binary" | ||
exit 1 | ||
fi | ||
|
||
chmod 755 gzrecover | ||
|
||
if ! mkdir -p "$PREFIX/bin"; then | ||
echo "Failed to create bin directory" | ||
exit 1 | ||
fi | ||
|
||
# Remove existing installation if present | ||
rm -f "$PREFIX/bin/gzrecover" | ||
|
||
mkdir -p $PREFIX/bin | ||
cp gzrecover $PREFIX/bin | ||
if ! cp gzrecover "$PREFIX/bin/"; then | ||
echo "Failed to install gzrecover" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters