Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebuilding when output file is missing (but input has not changed) #192

Open
daslu opened this issue Aug 8, 2022 · 0 comments
Open

rebuilding when output file is missing (but input has not changed) #192

daslu opened this issue Aug 8, 2022 · 0 comments

Comments

@daslu
Copy link

daslu commented Aug 8, 2022

In the following session, I am removing the output HTML file, and recalling build! does not regenerate it.
It would be nice to make it rebuild when the file is missing.

(following a Slack conversation:
https://clojurians.slack.com/archives/C02PF73SETZ/p1659910092271159)

Assume we have a file dummy.clj:

(ns dummy)
(rand)

Then, let us render it with Oz, remove the result HTML, and try to render again.

clj -Sdeps '{:deps {metasoarous/oz {:mvn/version "2.0.0-alpha5"}}}'

$ (require '[oz.core :as oz])

$ (oz/build! [{:from "dummy.clj" :to "dummy.html"}] :live? false :lazy? false :view? false :port 1234)

$ (clojure.java.shell/sh "ls" "-l" "dummy.html") ; verify the HTML exists:
{:exit 0, :out "-rw-rw-r-- 1 daslu daslu 3011 Aug  8 01:02 dummy.html\n", :err ""}

$ (clojure.java.shell/sh "rm" "dummy.html") ; remove the HTML:

$ (oz/build! [{:from "dummy.clj" :to "dummy.html"}] :live? false :lazy? false :view? false :port 1234)

$ (clojure.java.shell/sh "ls" "-l" "dummy.html") ; verify the HTML does not exist:
{:exit 2, :out "", :err "ls: cannot access 'dummy.html': No such file or directory\n"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant