Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-tools
Commits
def2aa01
Commit
def2aa01
authored
Dec 20, 2017
by
Michael Hanus
Browse files
CPM updated
parent
f431516f
Changes
1
Show whitespace changes
Inline
Side-by-side
cpm/src/CPM/PackageCopy.curry
View file @
def2aa01
...
...
@@ -176,16 +176,20 @@ getLocalPackageSpec dir =
--- Tries to find a package specification in the current directory or one of its
--- ancestors. Returns `Nothing` if there is not package specifiction.
--- In order to avoid infinite loops due to cyclic file structures,
--- the search is limited to 10 ancestor hierarchies.
searchLocalPackageSpec :: String -> IO (ErrorLogger (Maybe String))
searchLocalPackageSpec dir = do
searchLocalPackageSpec = searchLocalSpec 10
where
searchLocalSpec m dir = do
existsLocal <- doesFileExist $ dir </> "package.json"
if existsLocal
then succeedIO (Just dir)
else log Debug ("No package.json in " ++ show dir ++ ", trying " ++
show (dir </> "..")) |> do
parentExists <- doesDirectoryExist $ dir </> ".."
if
parentExists
then searchLocal
PackageSpec
$ dir </> ".."
if m>0 &&
parentExists
then searchLocal
Spec (m-1)
$ dir </> ".."
else succeedIO Nothing
--- Resolves the dependencies for a package copy and fills the package caches.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment