From 0205e5146b50ab066d152fccda0fc8cef4eef852 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 3 Dec 2020 02:09:57 -0400 Subject: Detect duplicate files coming from dependencies. --- stdlib/source/test/aedifex/command/clean.lux | 65 +++++++++++++++++----------- 1 file changed, 40 insertions(+), 25 deletions(-) (limited to 'stdlib/source/test/aedifex/command/clean.lux') diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux index 11570d034..739bd1a34 100644 --- a/stdlib/source/test/aedifex/command/clean.lux +++ b/stdlib/source/test/aedifex/command/clean.lux @@ -12,7 +12,7 @@ [data [binary (#+ Binary)] ["." product] - ["." text + ["." text ("#\." equivalence) ["%" format (#+ format)]] [number ["n" nat]] @@ -23,12 +23,14 @@ ["." random (#+ Random)]] [world ["." file (#+ Path File)]]] - [/// - ["@." profile] + [// + ["@." version] [// - [lux - [data - ["_." binary]]]]] + ["@." profile] + [// + [lux + [data + ["_." binary]]]]]] {#program ["." / ["//#" /// #_ @@ -97,22 +99,35 @@ sub-files (..files (format sub-path /)) dummy @profile.random] - (wrap (do promise.monad - [verdict (do {! (try.with promise.monad)} - [_ (..create-directory! fs target-path direct-files) - _ (..create-directory! fs sub-path sub-files) - context-exists!/pre (..directory-exists? fs context) - target-exists!/pre (..assets-exist? fs target-path direct-files) - sub-exists!/pre (..assets-exist? fs sub-path sub-files) - _ (/.do! fs (set@ #///.target (#.Some target-path) dummy)) - context-exists!/post (..directory-exists? fs context) - target-exists!/post (..assets-exist? fs target-path direct-files) - sub-exists!/post (..assets-exist? fs sub-path sub-files)] - (wrap (and (and context-exists!/pre - context-exists!/post) - (and target-exists!/pre - (not target-exists!/post)) - (and sub-exists!/pre - (not sub-exists!/post)))))] - (_.cover' [/.do!] - (try.default false verdict))))))) + ($_ _.and + (wrap (do promise.monad + [#let [console (@version.echo "")] + verdict (do {! (try.with promise.monad)} + [_ (/.do! console fs (set@ #///.target #.None dummy))] + (\ ! map (text\= /.failure) + (!.use (\ console read-line) [])))] + (_.cover' [/.failure] + (try.default false verdict)))) + (wrap (do promise.monad + [#let [console (@version.echo "")] + verdict (do {! (try.with promise.monad)} + [_ (..create-directory! fs target-path direct-files) + _ (..create-directory! fs sub-path sub-files) + context-exists!/pre (..directory-exists? fs context) + target-exists!/pre (..assets-exist? fs target-path direct-files) + sub-exists!/pre (..assets-exist? fs sub-path sub-files) + _ (/.do! console fs (set@ #///.target (#.Some target-path) dummy)) + context-exists!/post (..directory-exists? fs context) + target-exists!/post (..assets-exist? fs target-path direct-files) + sub-exists!/post (..assets-exist? fs sub-path sub-files) + logging (!.use (\ console read-line) [])] + (wrap (and (and context-exists!/pre + context-exists!/post) + (and target-exists!/pre + (not target-exists!/post)) + (and sub-exists!/pre + (not sub-exists!/post)) + (text\= /.success logging))))] + (_.cover' [/.do! /.success] + (try.default false verdict)))) + )))) -- cgit v1.2.3