raco pollen clone
deletes current directory if destination is .
#56
Closed
opened 10 years ago by frenchy64
·
4 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I structured my project with a
pollen-src
directory, then I ranraco pollen clone pollen-src/ .
at the root of my project and my project was deleted, as well as the root directory the project lives in.Right, because during a
clone
operation, the target directory gets deleted, and then replaced with the new cloned directory. In this case, because the target directory contained the source folder, it got deleted too.But I agree that behavior is too easy to trigger accidentally, so I’ve made a few changes:
clone
is now calledpublish
becauseclone
suggests a duplicate, but in fact many files are being left behind (e.g., Pollen source files and whatnot);The docs now emphasize that
publish
will overwrite a directory at the destination if it exists;raco pollen publish
will raise an error if the source directory is inside the target directory (which doesn’t make sense) or if you try to use the current working directory as the target directory.BTW if your original intention was to move or copy the files, that’s not what
raco pollen publish
is for — usemv
orcp
.PS. As I already concede in the docs for
raco pollen publish
, “This function is pretty lame, and I invite suggestions for improvement.”My original intention was to have a directory structure like
with the
.html
files being rendered automatically viaraco pollen clone
.I got the idea from this pollen repo, which implements this manually.
raco pollen publish
(néclone
) doesn’t do any file rendering — it’s just a way of copying a Pollen project directory without certain files. (Notice in the example you cite, there’s a call toraco pollen render index.ptree
earlier in the script, which accomplishes the rendering.)One issue with the example you link to — I don’t want to say that gentleman is doing it wrong, but I think he’s making things hard for himself — is that his CSS, Javascript, and webfonts are all in the directory above his
pollen-src
. That means he can’t use the Pollen project server to preview and test his files withinpollen-src
. Also, when the source and destination directories are overlapping, it creates the potential for headaches.The path of less resistance is to put all the source-side resources together:
Render the project in-place:
And then
raco pollen publish pollen-src
elsewhere: