Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
ghcup
Commits
56874f88
Unverified
Commit
56874f88
authored
6 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Use GHCUP_INSTALL_BASE_PREFIX in bootstrap-haskell
parent
99843f32
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bootstrap-haskell
+11
-9
11 additions, 9 deletions
bootstrap-haskell
with
11 additions
and
9 deletions
bootstrap-haskell
+
11
−
9
View file @
56874f88
...
...
@@ -3,6 +3,8 @@
# safety subshell to avoid executing anything in case this script is not downloaded properly
(
:
"
${
GHCUP_INSTALL_BASE_PREFIX
:
=
$HOME
}
"
die
()
{
(>
&2
printf
"
\\
033[0;31m%s
\\
033[0m
\\
n"
"
$1
"
)
exit
2
...
...
@@ -23,9 +25,9 @@ echo
echo
"It will add the 'cabal', 'ghc', and 'ghcup' executables to bin directory "
echo
"located at: "
echo
echo
"
$
HOME
/.ghcup/bin"
echo
"
$
GHCUP_INSTALL_BASE_PREFIX
/.ghcup/bin"
echo
echo
"and create the environment file
$
HOME
/.ghcup/env"
echo
"and create the environment file
$
GHCUP_INSTALL_BASE_PREFIX
/.ghcup/env"
echo
"which you should source in your ~/.bashrc or similar to get the required"
echo
"PATH components."
echo
...
...
@@ -40,21 +42,21 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
read
-r
answer </dev/tty
fi
edo
mkdir
-p
"
${
HOME
}
"
/.ghcup/bin
edo
mkdir
-p
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin
if
command
-V
"ghcup"
>
/dev/null 2>&1
;
then
if
[
-z
"
${
BOOTSTRAP_HASKELL_NO_UPGRADE
}
"
]
;
then
edo ghcup upgrade
fi
else
edo curl https://raw.githubusercontent.com/haskell/ghcup/master/ghcup
>
"
${
HOME
}
"
/.ghcup/bin/ghcup
edo
chmod
+x
"
${
HOME
}
"
/.ghcup/bin/ghcup
edo curl https://raw.githubusercontent.com/haskell/ghcup/master/ghcup
>
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
edo
chmod
+x
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
cat
<<-
EOF
> "
${
HOME
}
"/.ghcup/env || die "Failed to create env file"
export PATH="
\$
HOME/.cabal/bin:
\$
HOME/.ghcup/bin:
\$
PATH"
cat
<<-
EOF
> "
${
GHCUP_INSTALL_BASE_PREFIX
}
"/.ghcup/env || die "Failed to create env file"
export PATH="
\$
HOME/.cabal/bin:
\$
{GHCUP_INSTALL_BASE_PREFIX:=
\$
HOME
}
/.ghcup/bin:
\$
PATH"
EOF
# shellcheck disable=SC1090
edo
.
"
${
HOME
}
"
/.ghcup/env
edo
.
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/env
fi
edo ghcup
install
...
...
@@ -69,7 +71,7 @@ edo cabal new-install --symlink-bindir="$HOME/.cabal/bin" --jobs=1 cabal-install
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Installation done!"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Don't forget to source
$
HOME
/.ghcup/env in your ~/.bashrc or similar."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Don't forget to source
$
GHCUP_INSTALL_BASE_PREFIX
/.ghcup/env in your ~/.bashrc or similar."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment