Skip to content

Commit

Permalink
* Adds Buckaroo section to top-level config
Browse files Browse the repository at this point in the history
  • Loading branch information
njlr committed Dec 7, 2018
1 parent 37f3365 commit 6e310a2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions buckaroo/InstallCommand.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ open System
open System.IO
open Buckaroo.PackageLocation
open Buckaroo.BuckConfig
open FSharpx.Control

let private fetchManifestFromLock (lock : Lock) (sourceExplorer : ISourceExplorer) (package : PackageIdentifier) = async {
let location =
Expand Down Expand Up @@ -337,8 +338,26 @@ let writeTopLevelFiles (context : Tasks.TaskContext) (root : string) (lock : Loc
)
|> Map.ofSeq

let buckarooSection =
lock.Packages
|> Map.toSeq
|> Seq.map (fun (k, _) -> (PackageIdentifier.show k, INIString (computeCellIdentifier [] k)))
|> Seq.append [
(
"dependencies",
(
lock.Dependencies
|> Seq.map (fun d -> (computeCellIdentifier [] d.Package) + (Target.show d.Target))
|> String.concat " "
|> INIString
)
);
]
|> Map.ofSeq

let config =
Map.empty
|> Map.add "buckaroo" buckarooSection
|> Map.add "repositories" repositoriesSection

do! Files.mkdirp (Path.Combine(root, ".buckconfig.d"))
Expand Down

0 comments on commit 6e310a2

Please sign in to comment.