knit icon indicating copy to clipboard operation
knit copied to clipboard

Feature request: mark a file as precious

Open vicencb opened this issue 2 years ago • 0 comments

Similar to .PRECIOUS in a makefile, but not exactly the same: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html

The use case is:

Given the knitfile:

return b {
  $ knit-1.1.1.tar.gz :
    wget https://github.com/zyedidia/knit/archive/refs/tags/v1.1.1.tar.gz -O $(output)
}

The first knit invocations work as expected:

$ knit 
wget https://github.com/zyedidia/knit/archive/refs/tags/v1.1.1.tar.gz -O knit-1.1.1.tar.gz
$ knit 
knitfile: 'knit-1.1.1.tar.gz': nothing to be done

But after a cleanup:

$ rm -rf .knit

knit re-downloads the file already present:

$ knit 
wget https://github.com/zyedidia/knit/archive/refs/tags/v1.1.1.tar.gz -O knit-1.1.1.tar.gz

I would also expect such a file not to be removed by knit -t clean

vicencb avatar Oct 01 '23 18:10 vicencb