Merge pull request #1151 from niklasholm/patch-1

Fix issue #1107
This commit is contained in:
Алексей
2018-02-14 12:28:37 +03:00
committed by GitHub
3 changed files with 10 additions and 7 deletions

View File

@@ -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

View File

@@ -4,7 +4,7 @@
# Contributor: Alethea Rose <alethea@alethearose.com>
pkgname=filesystem
pkgver=2017.05
pkgver=2018.02
pkgrel=1
pkgdesc='Base filesystem'
arch=('i686' 'x86_64')

View File

@@ -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