From 000e81ffcbb6a3855c814434f8ea318e2900f7ef Mon Sep 17 00:00:00 2001 From: Niklas Holm Date: Wed, 14 Feb 2018 09:58:32 +0100 Subject: [PATCH] Change comment and always unset CD_HOME --- filesystem/05-home-dir.post | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/filesystem/05-home-dir.post b/filesystem/05-home-dir.post index 54ceb84b..553cebda 100644 --- a/filesystem/05-home-dir.post +++ b/filesystem/05-home-dir.post @@ -249,13 +249,11 @@ maybe_create_home () # c:\msys\usr\bin\bash -c "cd '%curdir'; export # CHERE_INVOKING=1; exec /usr/bin/bash --login -i" # - # Make sure we start in home unless invoked by CHERE - if [ ! -z "${CHERE_INVOKING}" ]; then - unset CHERE_INVOKING - elif [ "${CD_HOME}" = "yes" ]; then - unset CD_HOME + # Make sure we start in home if invoked through msys2_shell.cmd without -here option + if [ -z "${CHERE_INVOKING}" -a "${CD_HOME}" = "yes" ]; then cd "${HOME}" || echo "WARNING: Failed attempt to cd into ${HOME}!" fi + unset CHERE_INVOKING CD_HOME } maybe_create_home