From 3f710112f36f9c5825f3fbdfdea419d95b66daa5 Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@posteo.de>
Date: Tue, 31 Aug 2021 23:23:59 +0200
Subject: [PATCH] Rather do it in bootstrap-haskell
---
bootstrap-haskell | 7 +++++++
bootstrap-haskell.ps1 | 2 --
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/bootstrap-haskell b/bootstrap-haskell
index 2d51d9af..744f39a2 100755
--- a/bootstrap-haskell
+++ b/bootstrap-haskell
@@ -372,6 +372,13 @@ adjust_bashrc() {
echo "[[ -f ~/.bashrc ]] && source ~/.bashrc # ghcup-env" >> "${HOME}/.bash_profile"
fi
;;
+ MSYS*|MINGW*)
+ if [ ! -e "${HOME}/.bash_profile" ] ; then
+ echo '# generated by ghcup' > "${HOME}/.bash_profile"
+ echo 'test -f ~/.profile && . ~/.profile' >> "${HOME}/.bash_profile"
+ echo 'test -f ~/.bashrc && . ~/.bashrc' >> "${HOME}/.bash_profile"
+ fi
+ ;;
esac
break ;;
diff --git a/bootstrap-haskell.ps1 b/bootstrap-haskell.ps1
index 31a908ea..6c9d6c33 100644
--- a/bootstrap-haskell.ps1
+++ b/bootstrap-haskell.ps1
@@ -414,8 +414,6 @@ if (!(Test-Path -Path ('{0}' -f $MsysDir))) {
Print-Msg -msg 'Setting default home directory...'
Exec "$Bash" '-lc' "sed -i -e 's/db_home:.*$/db_home: windows/' /etc/nsswitch.conf"
- Print-Msg -msg "Creating ~/.bash_profile if it doesn't exist..."
- Exec "$Bash" '-lc' "[ -e ~/.bash_profile ] || echo -e '# generated by ghcup\ntest -f ~/.profile && . ~/.profile\ntest -f ~/.bashrc && . ~/.bashrc' > ~/.bash_profile"
} elseif ($msys2Decision -eq 1) {
Print-Msg -color Yellow -msg 'Skipping MSys2 installation.'
while ($true) {
--
GitLab