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
f09f4bd1
Commit
f09f4bd1
authored
4 years ago
by
Arjun Kathuria
Browse files
Options
Downloads
Patches
Plain Diff
Update the running of "Nuke" command in Main.hs
parent
a3b11f21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!101
[WIP] Feature "nuke"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/ghcup/Main.hs
+28
-16
28 additions, 16 deletions
app/ghcup/Main.hs
with
28 additions
and
16 deletions
app/ghcup/Main.hs
+
28
−
16
View file @
f09f4bd1
...
...
@@ -1701,27 +1701,39 @@ Make sure to clean up #{tmpdir} afterwards.|])
>>
pure
(
ExitFailure
13
)
else
putStrLn
uri'
>>
pure
ExitSuccess
Nuke
->
do
runLogger
$
$
logWarn
"WARNING: This will remove GHCup and all installed components from your system."
runLogger
$
$
logWarn
"Waiting 10 seconds before commencing, if you want to cancel it, now would be the time."
threadDelay
10000000
-- wait 10s
Nuke
->
runRm
(
do
lift
$
runLogger
$
$
logWarn
"WARNING: This will remove GHCup and all installed components from your system."
lift
$
runLogger
$
$
logWarn
"Waiting 10 seconds before commencing, if you want to cancel it, now would be the time."
liftIO
$
threadDelay
10000000
-- wait 10s
lift
$
runLogger
$
$
logInfo
"Initiating Nuclear Sequence 🚀🚀🚀"
lift
$
runLogger
$
$
logInfo
"Nuking in 3...2...1"
runLogger
$
$
logInfo
"Initiating Nuclear Sequence 🚀🚀🚀"
runLogger
$
$
logInfo
"Nuking in 3...2...1"
lInstalled
<-
runLogger
.
flip
runReaderT
appstate
$
listVersions
Nothing
(
Just
ListInstalled
)
forM_
lInstalled
$
runRm
.
rmTool
lInstalled
<-
lift
$
runLogger
.
flip
runReaderT
appstate
$
listVersions
Nothing
(
Just
ListInstalled
)
forM_
lInstalled
(
liftE
.
rmTool
)
leftOverFiles
<-
lift
$
runLogger
$
runReaderT
rmGhcupDirs
appstate
pure
leftOverFiles
)
>>=
\
case
VRight
leftOverFiles
->
do
leftOverFiles
<-
runLogger
$
runReaderT
rmGhcupDirs
appstate
case
length
leftOverFiles
of
0
->
do
runLogger
$
$
logInfo
"Nuclear Annihilation complete!"
pure
ExitSuccess
_
->
do
runLogger
$
$
logWarn
"These Directories/Files have survived Nuclear Annihilation, you may remove them manually."
forM_
leftOverFiles
(
runLogger
.
$
logDebug
.
T
.
pack
)
pure
ExitSuccess
case
length
leftOverFiles
of
0
->
runLogger
$
$
logInfo
"Nuclear Annihilation complete!"
_
->
do
runLogger
$
$
logWarn
"These Directories/Files have survived Nuclear Annihilation, you may remove them manually."
forM_
leftOverFiles
(
runLogger
.
$
logWarn
.
T
.
pack
)
VLeft
e
->
do
runLogger
$
$
(
logError
)
$
T
.
pack
$
prettyShow
e
pure
$
ExitFailure
15
pure
ExitSuccess
case
res
of
ExitSuccess
->
pure
()
...
...
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