                     project.scripts.append(script)
                     target.body.buildPhases.append(buildPhase)
                     print("✅ Script \(scriptName) was successfully added to \(target.name) target.")
-                    projectHasBeenUpdated = true
+                    needUpdateProject = true
                 }
             }
 
-        if projectHasBeenUpdated {
+        if needUpdateProject {
             try projectService.update(project)
         }
-        else {
+        else if !filelistsWereUpdated {
             print("🤷‍♂️ Nothing to update.")
         }
     }

                        }
                    }
                    if scriptHasBeenUpdated {
                        projectHasBeenUpdated = true
                        print("✅ Script \(scriptName) in target \(target.name) was successfully updated.")
                    }
                }

    func updateScript(withName scriptName: String, path: String?, format: Arguments.Format, targetName: String?) throws {
        let project = try projectService.project(path)

        var needUpdateProject = false
        var filelistsWereUpdated = false

        let filteredTargets = project.targets
            .filter { target in
