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
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
Eliza Zhang
ghcup
Commits
b3feba0c
Verified
Commit
b3feba0c
authored
5 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Improve choice messages and loop until proper answer is given
parent
5d323c11
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
+27
-35
27 additions, 35 deletions
bootstrap-haskell
with
27 additions
and
35 deletions
bootstrap-haskell
+
27
−
35
View file @
b3feba0c
...
...
@@ -96,41 +96,33 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
echo
"You may want to source '
$GHCUP_INSTALL_BASE_PREFIX
/.ghcup/env' in your shell"
echo
"configuration to do so (e.g. ~/.bashrc)."
if
[
-e
"
$HOME
/.bashrc"
]
;
then
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Detected ~/.bashrc on your system..."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"If you want ghcup to automatically fix your ~/.bashrc to include the required PATH variable"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"answer with YES and press ENTER."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Otherwise press ctrl-c to abort."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
read
-r
next_answer </dev/tty
case
$next_answer
in
[
Yy]
*
)
echo
"source
$GHCUP_INSTALL_BASE_PREFIX
/.ghcup/env"
>>
"
${
HOME
}
/.bashrc"
;;
*
)
exit
0
;;
esac
elif
[
-e
"
$HOME
/.bash_profile"
]
;
then
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Detected ~/.bash_profile on your system..."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"If you want ghcup to automatically fix your ~/.bash_profile to include the required PATH variable"
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"answer with YES and press ENTER."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
"Otherwise press ctrl-c to abort."
printf
"
\\
033[0;35m%s
\\
033[0m
\\
n"
""
read
-r
next_answer </dev/tty
case
$next_answer
in
[
Yy]
*
)
echo
"source
$GHCUP_INSTALL_BASE_PREFIX
/.ghcup/env"
>>
"
${
HOME
}
/.bash_profile"
;;
*
)
exit
0
;;
esac
fi
if
[
-f
"
$HOME
/.bashrc"
]
;
then
GHCUP_PROFILE_FILE
=
"
$HOME
/.bashrc"
elif
[
-f
"
$HOME
/.bash_profile"
]
;
then
GHCUP_PROFILE_FILE
=
"
$HOME
/.bash_profile"
fi
if
[
-n
"
${
GHCUP_PROFILE_FILE
}
"
]
&&
[
-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"
""
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
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