mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-06 10:59:22 +00:00
fix(scripts): use safe temp directories and fix composer exit code
- install-ntfy.sh: use mktemp -d with cleanup trap instead of /tmp/ntfy_* - install-git-crypt.sh: use mktemp -d with cleanup trap instead of /tmp/git-crypt - install-composer.sh: only move composer.phar if installation succeeded
This commit is contained in:
@@ -14,11 +14,10 @@ msgr run "Installing git-crypt"
|
||||
if ! command -v git-crypt &> /dev/null; then
|
||||
REPO_URL="https://github.com/AGWA/git-crypt.git"
|
||||
CHECK_PATH="${XDG_BIN_HOME}/git-crypt"
|
||||
BUILD_PATH="/tmp/git-crypt"
|
||||
BUILD_PATH="$(mktemp -d)"
|
||||
trap 'rm -rf "$BUILD_PATH"' EXIT
|
||||
|
||||
rm -rf "$BUILD_PATH"
|
||||
|
||||
if [ ! -d "$CHECK_PATH" ]; then
|
||||
if [ ! -f "$CHECK_PATH" ]; then
|
||||
git clone --depth 1 "$REPO_URL" "$BUILD_PATH" || { msgr err "Failed to clone $REPO_URL"; exit 1; }
|
||||
cd "$BUILD_PATH" || { msgr err "$BUILD_PATH not found"; exit 1; }
|
||||
make && make install PREFIX="$HOME/.local"
|
||||
|
||||
Reference in New Issue
Block a user