Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
eliadh
ghcup-hs
Commits
2ac8b61a
Verified
Commit
2ac8b61a
authored
5 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Fix bootstrap-haskell when ghcup is a broken script
Fixes #28
parent
8739cb46
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
+16
-11
16 additions, 11 deletions
bootstrap-haskell
with
16 additions
and
11 deletions
bootstrap-haskell
+
16
−
11
View file @
2ac8b61a
...
@@ -18,10 +18,14 @@ edo()
...
@@ -18,10 +18,14 @@ edo()
}
}
eghcup
()
{
eghcup
()
{
edo _eghcup
"
$@
"
}
_eghcup
()
{
if
[
-z
"
${
BOOTSTRAP_HASKELL_VERBOSE
}
"
]
;
then
if
[
-z
"
${
BOOTSTRAP_HASKELL_VERBOSE
}
"
]
;
then
edo
ghcup
"
$@
"
ghcup
"
$@
"
else
else
edo
ghcup
--verbose
"
$@
"
ghcup
--verbose
"
$@
"
fi
fi
}
}
...
@@ -81,6 +85,15 @@ download_ghcup() {
...
@@ -81,6 +85,15 @@ download_ghcup() {
edo curl
-Lf
"
${
_url
}
"
>
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
edo curl
-Lf
"
${
_url
}
"
>
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
edo
chmod
+x
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
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
.
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/env
eghcup upgrade
unset
_plat _arch _url _ghver _base_url
unset
_plat _arch _url _ghver _base_url
}
}
...
@@ -110,18 +123,10 @@ edo mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin
...
@@ -110,18 +123,10 @@ edo mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin
if
command
-V
"ghcup"
>
/dev/null 2>&1
;
then
if
command
-V
"ghcup"
>
/dev/null 2>&1
;
then
if
[
-z
"
${
BOOTSTRAP_HASKELL_NO_UPGRADE
}
"
]
;
then
if
[
-z
"
${
BOOTSTRAP_HASKELL_NO_UPGRADE
}
"
]
;
then
eghcup upgrade
_
eghcup upgrade
||
download_ghcup
fi
fi
else
else
download_ghcup
download_ghcup
edo
chmod
+x
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
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
.
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/env
eghcup upgrade
fi
fi
echo
echo
...
...
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