aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/deps.lux
blob: 67dc19e4717f47ca5c74ec9b79a78f11ca3ce388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(.module:
  [lux #*
   [abstract
    [monad (#+ do)]]
   [control
    [concurrency
     ["." promise (#+ Promise)]]]
   [data
    [collection
     ["." set (#+ Set)]]]
   [world
    ["." file]
    ["." console (#+ Console)]]]
  ["." // #_
   ["#." clean]
   ["/#" // #_
    [command (#+ Command)]
    [artifact (#+ Artifact)]
    [repository (#+ Repository)]
    ["#" profile]
    ["#." action (#+ Action)]
    ["#." cache]
    ["#." dependency #_
     ["#/." resolution (#+ Resolution)]]]])

(def: #export (do! console fs repositories profile)
  (-> (Console Promise) (file.System Promise) (List (Repository Promise)) (Command Resolution))
  (do ///action.monad
    [#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)
     _ (console.write-line //clean.success console)]
    (wrap resolution)))