mirror of
https://git.fsfe.org/FSFE/fsfe-local-build.git
synced 2026-04-18 10:23:05 +02:00
improve handling of (existing) directories with copy parameter
This commit is contained in:
@@ -80,7 +80,13 @@ if [ "$1" = "--copy" ]; then
|
||||
SRC_full=$(realpath $2)
|
||||
DST_full=$(echo $SRC_full | sed -E "s|$LOC_trunk|$LOC_out|")
|
||||
echo "[INFO] Copying $SRC_full to $DST_full..."
|
||||
cp -R $SRC_full $DST_full
|
||||
if [ -d "$SRC_full" ] && [ -e "$DST_full" ]; then
|
||||
rm -rf "$DST_full"
|
||||
cp -R $SRC_full $DST_full
|
||||
else
|
||||
cp -R $SRC_full $DST_full
|
||||
fi
|
||||
|
||||
shift
|
||||
done
|
||||
echo "[SUCCESS] Copying finished. Files should be visible via the local webserver now."
|
||||
@@ -96,6 +102,13 @@ if [ ! $(echo $SRC_full | grep "$LOC_trunk") ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# CHECK whether the source file is a directory (only --copy allowed)
|
||||
if [ -d "$SRC_full" ]; then
|
||||
echo "[ERROR] The given file \"$SRC_full\" is a directory. Those can only be copied by using --copy as a parameter."
|
||||
echo "NOTE: Using --copy won't build potential .xhtml files inside a directory. If you have this case, please first copy an empty directory and then build the .xhtml files inside them."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# TEST if a DEV SVN directory is used. If yes, copy clean file to this Dir
|
||||
if [ "$LOC_trunk_dev" != "" ]; then
|
||||
SRC_full_dev=$(echo $SRC_full | sed -E "s|$LOC_trunk|$LOC_trunk_dev|")
|
||||
|
||||
Reference in New Issue
Block a user