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
Iterations
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
Haskell
ghcup-hs
Commits
283f2a6e
Verified
Commit
283f2a6e
authored
3 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Add `ghcup whereis bindir` and friends, fixes
#221
parent
94637dfb
Branches
issue-221
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!163
Add `ghcup whereis bindir` and friends, fixes #221
Pipeline
#40215
failed
3 years ago
Stage: hlint
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/ghcup/Main.hs
+58
-1
58 additions, 1 deletion
app/ghcup/Main.hs
with
58 additions
and
1 deletion
app/ghcup/Main.hs
+
58
−
1
View file @
283f2a6e
...
...
@@ -205,6 +205,11 @@ data ChangeLogOptions = ChangeLogOptions
data
WhereisCommand
=
WhereisTool
Tool
(
Maybe
ToolVersion
)
|
WhereisBaseDir
|
WhereisBinDir
|
WhereisCacheDir
|
WhereisLogsDir
|
WhereisConfDir
data
WhereisOptions
=
WhereisOptions
{
directory
::
Bool
...
...
@@ -833,7 +838,8 @@ configP = subparser
whereisP
::
Parser
WhereisCommand
whereisP
=
subparser
(
command
(
commandGroup
"Tools locations:"
<>
command
"ghc"
(
WhereisTool
GHC
<$>
info
(
optional
(
toolVersionArgument
Nothing
(
Just
GHC
))
<**>
helper
)
...
...
@@ -868,6 +874,37 @@ whereisP = subparser
command
"ghcup"
(
WhereisTool
GHCup
<$>
info
(
(
pure
Nothing
)
<**>
helper
)
(
progDesc
"Get ghcup location"
))
)
<|>
subparser
(
commandGroup
"Directory locations:"
<>
command
"basedir"
(
info
(
pure
WhereisBaseDir
<**>
helper
)
(
progDesc
"Get ghcup base directory location"
)
)
<>
command
"bindir"
(
info
(
pure
WhereisBinDir
<**>
helper
)
(
progDesc
"Get ghcup binary directory location"
)
)
<>
command
"cachedir"
(
info
(
pure
WhereisCacheDir
<**>
helper
)
(
progDesc
"Get ghcup cache directory location"
)
)
<>
command
"logsdir"
(
info
(
pure
WhereisLogsDir
<**>
helper
)
(
progDesc
"Get ghcup logs directory location"
)
)
<>
command
"confdir"
(
info
(
pure
WhereisConfDir
<**>
helper
)
(
progDesc
"Get ghcup config directory location"
)
)
)
where
whereisGHCFooter
=
[
s
|
Discussion:
...
...
@@ -2136,6 +2173,26 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
runLogger
$
logError
$
T
.
pack
$
prettyShow
e
pure
$
ExitFailure
30
Whereis
_
WhereisBaseDir
->
do
putStr
baseDir
pure
ExitSuccess
Whereis
_
WhereisBinDir
->
do
putStr
binDir
pure
ExitSuccess
Whereis
_
WhereisCacheDir
->
do
putStr
cacheDir
pure
ExitSuccess
Whereis
_
WhereisLogsDir
->
do
putStr
logsDir
pure
ExitSuccess
Whereis
_
WhereisConfDir
->
do
putStr
confDir
pure
ExitSuccess
Upgrade
uOpts
force'
->
do
target
<-
case
uOpts
of
UpgradeInplace
->
Just
<$>
liftIO
getExecutablePath
...
...
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