aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex
diff options
context:
space:
mode:
authorEduardo Julian2020-11-24 05:18:04 -0400
committerEduardo Julian2020-11-24 05:18:04 -0400
commitc4bbfea18d995948012f45a6afda7a6e6ba56f84 (patch)
treeb3c425471830788965776fd173169f084d9f6af4 /stdlib/source/program/aedifex
parentd89d837de3475b75587a4293e094d755d2cd4626 (diff)
Better error messages when re-using a name when making a definition.
Diffstat (limited to 'stdlib/source/program/aedifex')
-rw-r--r--stdlib/source/program/aedifex/cache.lux2
-rw-r--r--stdlib/source/program/aedifex/command/deps.lux26
-rw-r--r--stdlib/source/program/aedifex/dependency/resolution.lux2
3 files changed, 12 insertions, 18 deletions
diff --git a/stdlib/source/program/aedifex/cache.lux b/stdlib/source/program/aedifex/cache.lux
index ef72dc988..dca14b496 100644
--- a/stdlib/source/program/aedifex/cache.lux
+++ b/stdlib/source/program/aedifex/cache.lux
@@ -72,7 +72,7 @@
(do {! (try.with promise.monad)}
[]
(|> (dictionary.entries resolution)
- (list.filter (|>> product.right //package.local?))
+ (list.filter (|>> product.right //package.local? not))
(monad.map ! (function (_ [dependency package])
(..write-one system dependency package)))
(:: ! map (set.from-list //artifact.hash)))))
diff --git a/stdlib/source/program/aedifex/command/deps.lux b/stdlib/source/program/aedifex/command/deps.lux
index 91bbf0ec1..bc4d88f6c 100644
--- a/stdlib/source/program/aedifex/command/deps.lux
+++ b/stdlib/source/program/aedifex/command/deps.lux
@@ -4,34 +4,28 @@
[monad (#+ do)]]
[control
[concurrency
- ["." promise]]]
+ ["." promise (#+ Promise)]]]
[data
[collection
- ["." set (#+ Set)]
- ["." list ("#\." functor)]]]
+ ["." set (#+ Set)]]]
[world
["." file]]]
["." /// #_
[command (#+ Command)]
[artifact (#+ Artifact)]
+ [repository (#+ Repository)]
["#" profile]
["#." action (#+ Action)]
["#." cache]
- ["#." repository]
["#." dependency #_
- ["#" resolution]]])
+ ["#/." resolution]]])
-(def: #export (do! profile)
- (Command (Set Artifact))
+(def: #export (do! fs repositories profile)
+ (-> (file.System Promise) (List (Repository Promise)) (Command (Set Artifact)))
(do ///action.monad
- [cache (///cache.read-all (file.async file.default)
- (set.to-list (get@ #///.dependencies profile))
- ///dependency.empty)
- resolution (///dependency.all (list\map (|>> ///repository.remote ///repository.async)
- (set.to-list (get@ #///.repositories profile)))
- (set.to-list (get@ #///.dependencies profile))
- cache)
- cached (///cache.write-all (file.async file.default)
- resolution)
+ [#let [dependencies (set.to-list (get@ #///.dependencies profile))]
+ cache (///cache.read-all fs dependencies ///dependency/resolution.empty)
+ resolution (///dependency/resolution.all repositories dependencies cache)
+ cached (///cache.write-all fs resolution)
#let [_ (log! "Successfully resolved dependencies!")]]
(wrap cached)))
diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux
index 8becf87dd..f5dbb0d54 100644
--- a/stdlib/source/program/aedifex/dependency/resolution.lux
+++ b/stdlib/source/program/aedifex/dependency/resolution.lux
@@ -107,7 +107,7 @@
["Artifact" (%.text (///artifact.format (get@ #//.artifact dependency)))]
["Type" (%.text (get@ #//.type dependency))]))
-(def: (any repositories dependency)
+(def: #export (any repositories dependency)
(-> (List (Repository Promise)) Dependency (Promise (Try Package)))
(case repositories
#.Nil