From: Oleg Broytman Date: Sun, 30 Apr 2017 21:24:08 +0000 (+0300) Subject: Fix rename-project: fix only exiting files X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=f9cb66b0a070eec5151adb1edc59634add7630d1;p=cookiecutter.git Fix rename-project: fix only exiting files --- diff --git a/rename-project b/rename-project index 749ad6d..14f4103 100755 --- a/rename-project +++ b/rename-project @@ -16,7 +16,11 @@ fix_path() { } fix_files() { - replace "$old_name" "$new_name" "$@" + for file in "$@"; do + if [ -f "$file" ]; then + replace "$old_name" "$new_name" "$file" + fi + done } for project_dir in "$HOME"/prog/Python "$HOME"/current/projects \