diff options
author | Mike Gerwitz <mike@mikegerwitz.com> | 2013-06-04 22:25:55 -0400 |
---|---|---|
committer | Mike Gerwitz <mike@mikegerwitz.com> | 2013-06-04 22:25:55 -0400 |
commit | ecfa48289842f99230dfe16df2b021a743eb1ddf (patch) | |
tree | 78f05c6ec2d6c82dca205447aa5b67945b3665f1 /tools | |
parent | d2bda9c49268a91bfc54b164c67f7ed6862e0be0 (diff) | |
download | thoughts-ecfa48289842f99230dfe16df2b021a743eb1ddf.tar.gz thoughts-ecfa48289842f99230dfe16df2b021a743eb1ddf.tar.bz2 thoughts-ecfa48289842f99230dfe16df2b021a743eb1ddf.zip |
Altered doc-cp to ensure that dest dir will always exist
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/doc-cp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/doc-cp b/tools/doc-cp index c87a435..b2312d4 100755 --- a/tools/doc-cp +++ b/tools/doc-cp @@ -38,7 +38,8 @@ dest="$( sstrip "$2" )" # the problem of naming conflicts and maintains the illusion of url rewriting # using only the filesystem [ -d "$( sstrip "$1" )" ] \ - && ( test -d "$dest" || mkdir -p "$dest" ) \ && dest="$dest/index.html" -cp -v "$1" "$dest" +dir="${dest%/*}" +( test -d "$dir" || mkdir -p "$dir" ) \ + && cp -v "$1" "$dest" |