Fix rename-project: fix only exiting files
[cookiecutter.git] / rename-project
index 749ad6d7a4b547de21184677e714ee84eb1cc9b3..14f41038e5027b99e89149e717709f039af6029c 100755 (executable)
@@ -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 \