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
d64426f1
Verified
Commit
d64426f1
authored
5 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Retab
parent
2e3968d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!125
Suggest to create .bash_profile if it doesn't exist
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bootstrap-haskell
+61
-61
61 additions, 61 deletions
bootstrap-haskell
with
61 additions
and
61 deletions
bootstrap-haskell
+
61
−
61
View file @
d64426f1
...
...
@@ -16,11 +16,11 @@ edo()
}
eghcup
()
{
if
[
-z
"
${
BOOTSTRAP_HASKELL_VERBOSE
}
"
]
;
then
edo ghcup
"
$@
"
else
edo ghcup
--verbose
"
$@
"
fi
if
[
-z
"
${
BOOTSTRAP_HASKELL_VERBOSE
}
"
]
;
then
edo ghcup
"
$@
"
else
edo ghcup
--verbose
"
$@
"
fi
}
echo
...
...
@@ -40,29 +40,29 @@ echo "PATH components."
echo
if
[
-z
"
${
BOOTSTRAP_HASKELL_NONINTERACTIVE
}
"
]
;
then
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"To proceed with the ghcup installation press ENTER, to cancel press ctrl-c."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Note that this script can be re-run at any given time."
echo
# Wait for user input to continue.
# shellcheck disable=SC2034
read
-r
answer </dev/tty
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"To proceed with the ghcup installation press ENTER, to cancel press ctrl-c."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Note that this script can be re-run at any given time."
echo
# Wait for user input to continue.
# shellcheck disable=SC2034
read
-r
answer </dev/tty
fi
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
eghcup upgrade
fi
if
[
-z
"
${
BOOTSTRAP_HASKELL_NO_UPGRADE
}
"
]
;
then
eghcup upgrade
fi
else
edo curl
--silent
https://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup
>
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
edo
chmod
+x
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/bin/ghcup
edo curl
--silent
https://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup
>
"
${
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
edo
.
"
${
GHCUP_INSTALL_BASE_PREFIX
}
"
/.ghcup/env
fi
echo
...
...
@@ -71,13 +71,13 @@ echo " $(ghcup print-system-reqs)"
echo
if
[
-z
"
${
BOOTSTRAP_HASKELL_NONINTERACTIVE
}
"
]
;
then
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"You may want to install these now, then press ENTER to proceed"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"or press ctrl-c to abort. Installation may take a while."
echo
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"You may want to install these now, then press ENTER to proceed"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"or press ctrl-c to abort. Installation may take a while."
echo
# Wait for user input to continue.
# shellcheck disable=SC2034
read
-r
answer </dev/tty
# Wait for user input to continue.
# shellcheck disable=SC2034
read
-r
answer </dev/tty
fi
eghcup
--cache
install
...
...
@@ -97,45 +97,45 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
echo
"configuration to do so (e.g. ~/.bashrc)."
if
[
-f
"
$HOME
/.bashrc"
]
;
then
GHCUP_PROFILE_FILE
=
"
$HOME
/.bashrc"
GHCUP_PROFILE_FILE
=
"
$HOME
/.bashrc"
elif
[
-f
"
$HOME
/.bash_profile"
]
;
then
GHCUP_PROFILE_FILE
=
"
$HOME
/.bash_profile"
else
# most complaints we get are from mac users who
# need assistance of setting up their shell, so suggest
# to create .bash_profile, which is a good guess
GHCUP_PROFILE_FILE
=
"
$HOME
/.bash_profile"
fi
if
[
-f
"
${
GHCUP_PROFILE_FILE
}
"
]
;
then
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Detected
\"
${
GHCUP_PROFILE_FILE
}
\"
on your system..."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"If you want ghcup to automatically fix your
\"
${
GHCUP_PROFILE_FILE
}
\"
to include the required PATH variable"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"answer with YES, otherwise with NO and press ENTER."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
elif
[
-n
"
${
BASH
}
"
]
;
then
# only suggest to create .bash_profile if we are in a bash shell
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Detected bash shell on your system..."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"If you want ghcup to automatically create
\"
${
GHCUP_PROFILE_FILE
}
\"
and include the required PATH variable"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"answer with YES, otherwise with NO and press ENTER."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
else
exit
0
fi
while
true
;
do
read
-r
next_answer </dev/tty
case
$next_answer
in
[
Yy]
*
)
echo
"source
$GHCUP_INSTALL_BASE_PREFIX
/.ghcup/env"
>>
"
${
GHCUP_PROFILE_FILE
}
"
exit
0
;;
[
Nn]
*
)
exit
0
;;
*
)
echo
"Please type YES or NO and press enter."
;;
esac
done
GHCUP_PROFILE_FILE
=
"
$HOME
/.bash_profile"
else
# most complaints we get are from mac users who
# need assistance of setting up their shell, so suggest
# to create .bash_profile, which is a good guess
GHCUP_PROFILE_FILE
=
"
$HOME
/.bash_profile"
fi
if
[
-f
"
${
GHCUP_PROFILE_FILE
}
"
]
;
then
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Detected
\"
${
GHCUP_PROFILE_FILE
}
\"
on your system..."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"If you want ghcup to automatically fix your
\"
${
GHCUP_PROFILE_FILE
}
\"
to include the required PATH variable"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"answer with YES, otherwise with NO and press ENTER."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
elif
[
-n
"
${
BASH
}
"
]
;
then
# only suggest to create .bash_profile if we are in a bash shell
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Detected bash shell on your system..."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"If you want ghcup to automatically create
\"
${
GHCUP_PROFILE_FILE
}
\"
and include the required PATH variable"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"answer with YES, otherwise with NO and press ENTER."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
else
exit
0
fi
while
true
;
do
read
-r
next_answer </dev/tty
case
$next_answer
in
[
Yy]
*
)
echo
"source
$GHCUP_INSTALL_BASE_PREFIX
/.ghcup/env"
>>
"
${
GHCUP_PROFILE_FILE
}
"
exit
0
;;
[
Nn]
*
)
exit
0
;;
*
)
echo
"Please type YES or NO and press enter."
;;
esac
done
fi
)
...
...
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