summaryrefslogtreecommitdiff
path: root/localezmangle
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-12-03 01:33:15 +0000
committerJonas Smedegaard <dr@jones.dk>2002-12-03 01:33:15 +0000
commite2ea84e1b33baca7778169a785d905d268540898 (patch)
treecca7dde1bc67fbb0492a8ff1b2145d2ec43a9e41 /localezmangle
parentaad98a932e72b69d751561c9ea6c25b96ada1ebd (diff)
localezmangle: Avoid copying into existing targetdir. Improved error messages.
Diffstat (limited to 'localezmangle')
-rwxr-xr-xlocalezmangle12
1 files changed, 9 insertions, 3 deletions
diff --git a/localezmangle b/localezmangle
index 88147a9..89d1c4f 100755
--- a/localezmangle
+++ b/localezmangle
@@ -3,7 +3,7 @@
# /usr/local/bin/localezmangle
# Copyright 2001-2002 Jonas Smedegaard <dr@jones.dk>
#
-# $Id: localezmangle,v 1.3 2002-12-03 01:11:25 jonas Exp $
+# $Id: localezmangle,v 1.4 2002-12-03 01:33:15 jonas Exp $
#
# Extract, rename and auto-mangle eZ Publish 2.2.x templates and languages
#
@@ -50,12 +50,18 @@ if [ ! -f $sedrules ]; then
fi
if [ -n "$origdir" -a -d "$origdir" ]; then
+ if [ -d "$targetdir" ]; then
+ echo "ERROR: origdir provided and targetdir exists already"
+ echo "(avoid providing origdir when updating an existing targetdir)."
+ echo "Exiting...!"
+ exit 1
+ fi
# Isolate all template files
for x in `cd $origdir && find * -type f | grep -v cache | grep "$origname"`; do mkdir -p $targetdir/`dirname $x`; cp -a $origdir/$x $targetdir/`dirname $x`; done
elif [ -d "$targetdir" ]; then
- echo "Notice: origdir not provided. Working with existing targetdir..."
+ echo "NOTICE: origdir not provided. Working with existing targetdir..."
else
- echo "Error: origdir not provided, and targetdir doesn't exist. Exiting...!"
+ echo "ERROR: origdir not provided, and targetdir doesn't exist. Exiting...!"
exit 1
fi