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
1dfe5cfe
Commit
1dfe5cfe
authored
4 years ago
by
Arjun Kathuria
Browse files
Options
Downloads
Patches
Plain Diff
updates path equating (which may fail) in "rmGhcup" function.
parent
8e455065
No related branches found
No related tags found
1 merge request
!101
[WIP] Feature "nuke"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/GHCup.hs
+20
-1
20 additions, 1 deletion
lib/GHCup.hs
with
20 additions
and
1 deletion
lib/GHCup.hs
+
20
−
1
View file @
1dfe5cfe
...
@@ -1294,8 +1294,23 @@ rmGhcup = do
...
@@ -1294,8 +1294,23 @@ rmGhcup = do
AppState
{
dirs
=
Dirs
{
binDir
}}
<-
ask
AppState
{
dirs
=
Dirs
{
binDir
}}
<-
ask
let
ghcupFilename
=
"ghcup"
<>
exeExt
let
ghcupFilename
=
"ghcup"
<>
exeExt
let
ghcupFilepath
=
binDir
</>
ghcupFilename
let
ghcupFilepath
=
binDir
</>
ghcupFilename
currentRunningExecPath
<-
liftIO
$
getExecutablePath
currentRunningExecPath
<-
liftIO
$
getExecutablePath
if
currentRunningExecPath
==
ghcupFilepath
-- if paths do no exist, warn user, and continue to compare them, as is,
-- which should eventually fail and result in a non-standard install warning
p1
<-
handleIO'
doesNotExistErrorType
(
handlePathNotPresent
currentRunningExecPath
)
(
liftIO
$
canonicalizePath
currentRunningExecPath
)
p2
<-
handleIO'
doesNotExistErrorType
(
handlePathNotPresent
ghcupFilename
)
(
liftIO
$
canonicalizePath
ghcupFilename
)
let
areEqualPaths
=
equalFilePath
p1
p2
if
areEqualPaths
then
then
do
do
#
if
defined
(
IS_WINDOWS
)
#
if
defined
(
IS_WINDOWS
)
...
@@ -1315,6 +1330,10 @@ rmGhcup = do
...
@@ -1315,6 +1330,10 @@ rmGhcup = do
nonStandardInstallLocationMsg
currentRunningExecPath
nonStandardInstallLocationMsg
currentRunningExecPath
where
where
handlePathNotPresent
fp
_err
=
do
$
logWarn
$
"Error: The path does not exist, "
<>
T
.
pack
fp
pure
fp
nonStandardInstallLocationMsg
path
=
T
.
pack
$
nonStandardInstallLocationMsg
path
=
T
.
pack
$
"current ghcup is invoked from a non-standard location:
\n
"
"current ghcup is invoked from a non-standard location:
\n
"
<>
path
<>
<>
path
<>
...
...
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