Skip to content

Commit

Permalink
chore: fixed small typo in install script (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
FajarKim authored Jan 28, 2024
1 parent c669fae commit 55faa58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
13 changes: 7 additions & 6 deletions tools/Linux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
set -e

# Make sure important variables exist if not already defined
#
# $USER is defined by login(1) which is not always executed (e.g. containers)
# POSIX: https://pubs.opengroup.org/onlinepubs/009695299/utilities/id.html
USER=${USER:-$(id -u -n)}
Expand All @@ -38,18 +39,18 @@ HOME="${HOME:-$(getent passwd $USER 2>/dev/null | cut -d: -f6)}"
# macOS does not have getent, but this works even if $HOME is unset
HOME="${HOME:-$(eval echo ~$USER)}"

# Test directory 'cache'
test -d "$HOME/.cache" && test -w "$HOME/.cache" && test -x "$HOME/.cache" || {
mkdir "$HOME/.cache" >/dev/null 2>&1
# Check directory $HOME/.config. If it doesn't exist, a folder will be created.
test -d "$HOME/.config" && test -w "$HOME/.config" && test -x "$HOME/.config" || {
mkdir "$HOME/.config" >/dev/null 2>&1
}

# Test directory '$PATH'
# Check directory $PATH.
test -d "$PATH" && test -w "$PATH" && test -x "$PATH" || {
PATH=$(command -v 'bash' | sed 's|/bash||g')
PATH=$(dirname `command -v "bash"`)
}

# Default settings
BZSH="${BZSH:-$HOME/.cache/.bz2-shell}"
BZSH="${BZSH:-$HOME/.config/.bz2-shell}"
REPO=${REPO:-FajarKim/bz2-shell}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}
Expand Down
19 changes: 7 additions & 12 deletions tools/Termux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,25 @@
#
set -e

# Make sure important variables exist if not already defined
# $USER is defined by login(1) which is not always executed (e.g. containers)
# POSIX: https://pubs.opengroup.org/onlinepubs/009695299/utilities/id.html
USER=${USER:-$(id -u -n)}

# Test directory '/data/data/com.termux/files/usr'
# Check directory /data/data/com.termux/files/usr.
test -d "$PREFIX" && test -w "$PREFIX" && test -x "$PREFIX" || test -d /data/data/com.termux/files/usr && test -w /data/data/com.termux/files/usr && test -x /data/data/com.termux/files/usr || {
mkdir "/data/data/com.termux/files/usr" >/dev/null 2>&1
}

PREFIX=/data/data/com.termux/files/usr

# Test directory '/data/data/com.termux/files/usr/shared'
test -d "$PREFIX/shared" && test -w "$PREFIX/shared" && test -x "$PREFIX/shared" || {
mkdir "$PREFIX/shared" >/dev/null 2>&1
# Check directory /data/data/com.termux/files/usr/lib.
test -d "$PREFIX/lib" && test -w "$PREFIX/lib" && test -x "$PREFIX/lib" || {
mkdir "$PREFIX/lib" >/dev/null 2>&1
}

# Test directory '$PATH'
# Check directory $PATH.
test -d "$PATH" && test -w "$PATH" && test -x "$PATH" || {
PATH=$(command -v 'bash' | sed 's|/bash||g')
PATH=$(dirname `command -v "bash"`)
}

# Default settings
BZSH="${BZSH:-$PREFIX/shared/bz2-shell}"
BZSH="${BZSH:-$PREFIX/lib/bz2-shell}"
REPO=${REPO:-FajarKim/bz2-shell}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}
Expand Down

0 comments on commit 55faa58

Please sign in to comment.