From 7880b49027de8d450dbdd30abd3acaa2c2e2d366 Mon Sep 17 00:00:00 2001 From: Joel Fernandes Date: Tue, 10 Jul 2018 09:13:09 -0700 Subject: [PATCH] androdeb: fix incorrect home directory variable The following command fails on androdeb. The output looks like: curl https://sh.rustup.rs -sSf | sh info: downloading installer error: $HOME differs from euid-obtained home directory: you may be using sudo error: if this is what you want, restart the installation with `-y' This is because home directory wasn't set. Signed-off-by: Joel Fernandes --- addons/bashrc | 4 ++++ addons/bashrc.silent | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/addons/bashrc b/addons/bashrc index 815ca70..30c1388 100644 --- a/addons/bashrc +++ b/addons/bashrc @@ -16,3 +16,7 @@ echo "" touch .banner.shown fi + +homedir=$( getent passwd "$USER" | cut -d: -f6 ) +export HOME=$homedir +cd $HOME diff --git a/addons/bashrc.silent b/addons/bashrc.silent index c49f02e..95f23f0 100644 --- a/addons/bashrc.silent +++ b/addons/bashrc.silent @@ -1 +1,5 @@ source .bashrc.common + +homedir=$( getent passwd "$USER" | cut -d: -f6 ) +export HOME=$homedir +cd $HOME