Altered doc-cp to ensure that dest dir will always exist

master
Mike Gerwitz 2013-06-04 22:25:55 -04:00
parent d2bda9c492
commit ecfa482898
1 changed files with 3 additions and 2 deletions

View File

@ -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"