Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository 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
Glasgow Haskell Compiler
Packages
Cabal
Commits
186d448f
Commit
186d448f
authored
3 years ago
by
Patrick Augusto
Browse files
Options
Downloads
Patches
Plain Diff
Changing to canonicalizePathNoThrow to prevent exceptions
parent
5892f423
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/src/Distribution/Client/Init/NonInteractive/Heuristics.hs
+1
-1
1 addition, 1 deletion
...src/Distribution/Client/Init/NonInteractive/Heuristics.hs
cabal-install/src/Distribution/Client/Init/Types.hs
+3
-3
3 additions, 3 deletions
cabal-install/src/Distribution/Client/Init/Types.hs
with
4 additions
and
4 deletions
cabal-install/src/Distribution/Client/Init/NonInteractive/Heuristics.hs
+
1
−
1
View file @
186d448f
...
...
@@ -85,7 +85,7 @@ guessLanguage = do
-- | Guess the package name based on the given root directory.
guessPackageName
::
Interactive
m
=>
FilePath
->
m
PackageName
guessPackageName
=
fmap
(
mkPackageName
.
repair
.
fromMaybe
""
.
safeLast
.
splitDirectories
)
.
tryC
anonicalizePath
.
c
anonicalizePath
NoThrow
where
-- Treat each span of non-alphanumeric characters as a hyphen. Each
-- hyphenated component of a package name must contain at least one
...
...
This diff is collapsed.
Click to expand it.
cabal-install/src/Distribution/Client/Init/Types.hs
+
3
−
3
View file @
186d448f
...
...
@@ -301,7 +301,7 @@ class Monad m => Interactive m where
listDirectory
::
FilePath
->
m
[
FilePath
]
doesDirectoryExist
::
FilePath
->
m
Bool
doesFileExist
::
FilePath
->
m
Bool
tryC
anonicalizePath
::
FilePath
->
m
FilePath
c
anonicalizePath
NoThrow
::
FilePath
->
m
FilePath
readProcessWithExitCode
::
FilePath
->
[
String
]
->
String
->
m
(
ExitCode
,
String
,
String
)
getEnvironment
::
m
[(
String
,
String
)]
listFilesInside
::
(
FilePath
->
m
Bool
)
->
FilePath
->
m
[
FilePath
]
...
...
@@ -329,7 +329,7 @@ instance Interactive IO where
listDirectory
=
P
.
listDirectory
doesDirectoryExist
=
P
.
doesDirectoryExist
doesFileExist
=
P
.
doesFileExist
tryC
anonicalizePath
=
P
.
tryC
anonicalizePath
c
anonicalizePath
NoThrow
=
P
.
c
anonicalizePath
NoThrow
readProcessWithExitCode
=
P
.
readProcessWithExitCode
getEnvironment
=
P
.
getEnvironment
listFilesInside
=
P
.
listFilesInside
...
...
@@ -356,7 +356,7 @@ instance Interactive PurePrompt where
listDirectory
!
_
=
popList
doesDirectoryExist
!
_
=
popBool
doesFileExist
!
_
=
popBool
tryC
anonicalizePath
!
_
=
popAbsolute
c
anonicalizePath
NoThrow
!
_
=
popAbsolute
readProcessWithExitCode
!
_
!
_
!
_
=
do
input
<-
pop
return
(
ExitSuccess
,
input
,
""
)
...
...
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