(when(not(directory-exists?source-dir))(error'clone(format"source directory ~a does not exist"source-dir)))
(when(not(directory-exists?source-dir))(error'publish(format"source directory ~a does not exist"source-dir)))
(definetarget-dir(simplify-path,target-path))
(definetarget-dir(simplify-path,target-path))
(when(source-dir.contains-directory?.target-dir)(error'clone"aborted because target directory for cloning (~a) can't be inside source directory (~a)"target-dirsource-dir))
(when(source-dir.contains-directory?.target-dir)(error'publish"aborted because target directory for publishing (~a) can't be inside source directory (~a)"target-dirsource-dir))
(displayln"Cloning ...")
(when(target-dir.contains-directory?.source-dir)(error'publish"aborted because target directory for publishing (~a) can't contain source directory (~a)"target-dirsource-dir))
(when(equal?target-dir(current-directory))(error'publish"aborted because target directory for publishing (~a) can't be the same as current directory (~a)"target-dir(current-directory)))
@ -83,15 +83,15 @@ Alternatively, the command can take a variable number of path arguments. @racket
> raco pollen render *.html.pm}
> raco pollen render *.html.pm}
@section{@racket[raco pollen clone]}
@section{@racket[raco pollen publish]}
Make a copy of the project directory on the desktop, and remove any source files or other Pollen-related files. (This function is pretty lame, and I invite suggestions for improvement.)
Make a copy of the project directory on the desktop, but without any source files or other Pollen-related files. (This function is pretty lame, and I invite suggestions for improvement.)
@racket[raco pollen clone _source-dir] will clone source from @racket[_source-dir] onto the desktop.
@racket[raco pollen publish _project-dir] will publish the project in @racket[_project-dir] onto the desktop in a folder called @racket[publish]. @bold{Warning}: if @racket[publish] already exists on the desktop, it will be overwritten.
@racket[raco pollen clone _source-dir _dest-dir] will clone source from @racket[_source-dir] to @racket[_dest-dir] rather than the desktop.
@racket[raco pollen publish _project-dir _dest-dir] will publish the project in @racket[_project-dir] to @racket[_dest-dir] rather than the desktop. @bold{Warning}: if @racket[_dest-dir] already exists, it will be overwritten by the newly published directory.
If you're already in the project directory and want to clone somewhere other than the desktop, use @racket[raco pollen clone _. _dest-dir].
If you're already in your project directory and want to publish somewhere other than the desktop, use @racket[raco pollen publish _. _dest-dir].