Skip to content

Commit

Permalink
Merge pull request #1198 from ivan-hc/dev
Browse files Browse the repository at this point in the history
Fix "$SCRIPTDIR" in sistems without XDG_DESKTOP_DIR
  • Loading branch information
ivan-hc authored Dec 10, 2024
2 parents 4c02b62 + d23125d commit db9b6f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 3 additions & 2 deletions APP-MANAGER
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

AMVERSION="9.3-1"
AMVERSION="9.3-2"

# Determine main repository and branch
AMREPO="https://raw.githubusercontent.com/ivan-hc/AM/main"
Expand All @@ -27,7 +27,8 @@ export CONFIGDIR="${XDG_CONFIG_HOME:-$HOME/.config}"
export CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
export APPMANCONFIG="$CONFIGDIR/appman"
APPMANCONFIG="$CONFIGDIR/appman"
SCRIPTDIR="$(xdg-user-dir DESKTOP 2>/dev/null || echo "$HOME")"
SCRIPTDIR="${SCRIPTDIR:-$(xdg-user-dir DESKTOP 2>/dev/null)}"
[ -d "$SCRIPTDIR" ] || SCRIPTDIR="$PWD"
export SCRIPTDIR

# Colors
Expand Down
6 changes: 1 addition & 5 deletions modules/install.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ _download() {
if curl --output /dev/null --silent --head --fail "$APPSDB/$arg" 1>/dev/null; then
cd "$SCRIPTDIR" || return 1
[ ! -f ./"$arg" ] && wget -q "$APPSDB/$arg" || return 1
echo "\"$arg\" installation script downloaded! "
elif curl --output /dev/null --silent --head --fail "$AMREPO/testing/$ARCH/$arg" 1>/dev/null; then
cd "$SCRIPTDIR" || return 1
[ ! -f ./"$arg" ] && wget -q "$AMREPO/testing/$ARCH/$arg" || return 1
echo " ⚠️ \"$arg\" downloaded from \"testing\", the unstable branch, BE AWARE!"
echo "\"$arg\" installation script downloaded to \"$SCRIPTDIR\"! " | _fit
else
echo " 💀 ERROR: \"$arg\" is NOT a valid argument"
fi
Expand Down

0 comments on commit db9b6f9

Please sign in to comment.