Follow-up cleanup from haskell/ghcup-hs!229 (comment 402211)
This changes the indentation from tabs to spaces, since tabs get stripped by the heredoc.
Follow-up cleanup from !229 (comment 402211)
Follow-up cleanup from haskell/ghcup-hs!229 (comment 402211)
Rufflewind (2ebff1e8) at 26 Jan 09:16
I also noticed all whitespaces are stripped, which makes the file hard to read, so we'll have to adjust the cat/EOF thing.
I changed the indentation within the heredoc to four spaces: !232 (merged)
Anything else needed?
Rufflewind (1fd7de27) at 26 Jan 09:09
Avoid adding duplicates to PATH
So, if there is an absolute need to have ~/.ghcup/env
usable both (a) on demand and (b) also passively through the rc file, then one could introduce another script, say ~/.ghcup/env-init
, which invokes ~/.ghcup/env
with conditional guards to ensure idempotency. Then, ~/.bashrc
can call ~/.ghcup/env-init
.
This would hide the complexity from the user's ~/.bashrc
and avoid clutter. What do you think?
Rufflewind (3565c32d) at 08 Jan 08:35
Avoid adding duplicates to PATH
Without this, each time the env script gets executed it will add a copy of the paths to PATH. This can happen when shells are nested.
The "case" trick was inspired by: https://github.com/rust-lang/rustup/blob/184a899f4529f27e23eca537a5979c530ff7fa26/src/cli/self_update/env.sh
Rufflewind (c4c50b9c) at 24 Dec 22:42
Avoid adding duplicates to PATH
Rufflewind (29abfb66) at 24 Dec 22:30
Avoid adding duplicates to PATH