From 8643b23b7bdc8b56d5f87178871070739622c43e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 31 Mar 2022 18:30:23 +0300 Subject: feat: implement find, tag, untag, is-tag Sponsored-by: author --- cachedir.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'cachedir.md') diff --git a/cachedir.md b/cachedir.md index 2f2607a..246cc5d 100644 --- a/cachedir.md +++ b/cachedir.md @@ -49,12 +49,14 @@ tags as requested._ We should find no cache directories, if there aren't any. - -given an installed cachedir - ~~~scenario +given an installed cachedir when I run cachedir find . then stdout is exactly "" +when I try to run cachedir is-cache foo +then command fails +when I try to run cachedir is-cache bar +then command fails ~~~ When we create a directory, and a `CACHEDIR.TAG` file with the wrong @@ -63,8 +65,12 @@ contents, it's not a cache directory. ~~~scenario given a directory foo given file foo/CACHEDIR.TAG from not-a-tag -when I run cachedir . +when I run cachedir find . then stdout is exactly "" +when I try to run cachedir is-cache foo +then command fails +when I try to run cachedir is-cache bar +then command fails ~~~ When we create an actual tag, the directory is found. @@ -74,6 +80,10 @@ given a directory bar when I run cachedir tag bar when I run cachedir find . then stdout contains "/bar" +when I try to run cachedir is-cache foo +then command fails +when I try to run cachedir is-cache bar +then command is successful ~~~ Finally, we should again find no cache directories if we remove that tag. @@ -82,4 +92,8 @@ Finally, we should again find no cache directories if we remove that tag. when I run cachedir untag bar when I run cachedir find . then stdout is exactly "" +when I try to run cachedir is-cache foo +then command fails +when I try to run cachedir is-cache bar +then command fails ~~~ -- cgit v1.2.1