Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixed small typo in install script #3

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading