Skip to content

Commit

Permalink
cli: ensure files copied by template are writable
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohalt committed Jan 25, 2024
1 parent 6ff22cc commit 4ccf013
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/nextjournal/garden_cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@
(fs/delete-if-exists "garden.edn"))

(defn template [target-dir]
(fs/copy-tree (fs/path (io/resource "project-template")) target-dir {:replace-existing true
:posix-file-permissions "rwxr-xr-x"}))
(let [perms "rwxr-xr-x"]
(fs/copy-tree (fs/path (io/resource "project-template")) target-dir {:replace-existing true
:posix-file-permissions perms})
(fs/walk-file-tree target-dir {:pre-visit-dir (fn [dir _] (fs/set-posix-file-permissions dir perms) :continue)
:visit-file (fn [file _] (fs/set-posix-file-permissions file perms) :continue)})))

(defn project-dir []
(fs/cwd))
Expand Down

0 comments on commit 4ccf013

Please # to comment.