From e2ea84e1b33baca7778169a785d905d268540898 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 3 Dec 2002 01:33:15 +0000 Subject: localezmangle: Avoid copying into existing targetdir. Improved error messages. --- localezmangle | 12 +++++++++--- 1 file 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 # -# $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 -- cgit v1.2.3