diff --git a/filesystem/05-home-dir.post b/filesystem/05-home-dir.post index 19fad50b..9aa39761 100644 --- a/filesystem/05-home-dir.post +++ b/filesystem/05-home-dir.post @@ -227,14 +227,16 @@ maybe_create_home () echo echo "They will never be overwritten nor automatically updated." echo + local cur_pwd="$PWD" cd /etc/skel || echo "WARNING: Failed attempt to cd into /etc/skel!" local f= /usr/bin/find . -type f | while read f; do - local fDest=${f#.} + local fDest="${f#.}" if [ ! -e "${HOME}${fDest}" -a ! -L "${HOME}${fDest}" ]; then - /usr/bin/install -D -p -v "${f}" "${HOME}/${fDest}" + /usr/bin/install -D -p -v "${f}" "${HOME}${fDest}" fi done + cd "${cur_pwd}" else echo "${HOME} could not be created." { [ -d "${TEMP}" ] && HOME="${TEMP}"; } || @@ -249,12 +251,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 - else + # 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 diff --git a/filesystem/PKGBUILD b/filesystem/PKGBUILD index 2b338343..d3e5a184 100644 --- a/filesystem/PKGBUILD +++ b/filesystem/PKGBUILD @@ -4,7 +4,7 @@ # Contributor: Alethea Rose pkgname=filesystem -pkgver=2017.05 +pkgver=2018.02 pkgrel=1 pkgdesc='Base filesystem' arch=('i686' 'x86_64') diff --git a/filesystem/msys2_shell.cmd b/filesystem/msys2_shell.cmd index 2495a46e..98c3c504 100644 --- a/filesystem/msys2_shell.cmd +++ b/filesystem/msys2_shell.cmd @@ -68,6 +68,8 @@ if "%MSYSTEM%" == "MINGW32" ( set "CONTITLE=MSYS2 MSYS" ) +set CD_HOME=yes + if "x%MSYSCON%" == "xmintty.exe" goto startmintty if "x%MSYSCON%" == "xconemu" goto startconemu if "x%MSYSCON%" == "xdefterm" goto startsh