Fix rename-project: fix only exiting files
authorOleg Broytman <phd@phdru.name>
Sun, 30 Apr 2017 21:24:08 +0000 (00:24 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 30 Apr 2017 21:33:50 +0000 (00:33 +0300)
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 \