fix username on Android

This commit is contained in:
Dmytro Meleshko 2018-08-23 22:46:00 +02:00
parent 2c73d5ced9
commit f0b9378593
2 changed files with 9 additions and 1 deletions

View file

@ -6,7 +6,11 @@ export LC_ALL="$LANG"
if [[ -z "$USER" && -n "$USERNAME" ]]; then if [[ -z "$USER" && -n "$USERNAME" ]]; then
export USER="$USERNAME" export USER="$USERNAME"
fi fi
export DEFAULT_USER="dmitmel" if is_android; then
export DEFAULT_USER="$USER"
else
export DEFAULT_USER="dmitmel"
fi
if [[ -n "$SSH_CONNECTION" ]]; then if [[ -n "$SSH_CONNECTION" ]]; then
export EDITOR="rmate" export EDITOR="rmate"

View file

@ -8,6 +8,10 @@ is_macos() {
[[ "$OSTYPE" == darwin* ]] [[ "$OSTYPE" == darwin* ]]
} }
is_android() {
[[ "$OSTYPE" == linux-android ]]
}
command_exists() { command_exists() {
command -v "$1" >/dev/null 2>&1 command -v "$1" >/dev/null 2>&1
} }