Skip to content
Open
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
20 changes: 9 additions & 11 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,21 @@
install_filemanager()
{
trap 'echo -e "Aborted, error $? in command: $BASH_COMMAND"; trap ERR; return 1' ERR
filemanager_os="unsupported"
filemanager_arch="unknown"
install_path="/usr/local/bin"

# Termux on Android has $PREFIX set which already ends with /usr
if [[ -n "$ANDROID_ROOT" && -n "$PREFIX" ]]; then
install_path="$PREFIX/bin"
fi
# defaults to /usr/local
[[ -z "$PREFIX" ]] && PREFIX="/usr/local"

# Fall back to /usr/bin if necessary
if [[ ! -d $install_path ]]; then
install_path="/usr/bin"
fi
filemanager_os="unsupported"
filemanager_arch="unknown"
install_path="$PREFIX/bin"

# Not every platform has or needs sudo (https://termux.com/linux.html)
((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo"

# ensure directories exists
[[ ! -d "$PREFIX" ]] && mkdir -p "$PREFIX"
[[ ! -d "$install_path" ]] && mkdir -p "$install_path"

#########################
# Which OS and version? #
#########################
Expand Down