     func updateScript(withName scriptName: String, path: String?, format: Arguments.Format, targetName: String?) throws {
         let project = try projectService.project(path)
 
-        var projectHasBeenUpdated = false
+        var needUpdateProject = false
+        var filelistsWereUpdated = false
 
         let filteredTargets = project.targets
             .filter { target in

                    project.scripts.append(script)
                    target.body.buildPhases.append(buildPhase)
                    print("✅ Script \(scriptName) was successfully added to \(target.name) target.")
                    projectHasBeenUpdated = true
                }
            }

        if projectHasBeenUpdated {
            try projectService.update(project)
        }
        else {
            print("🤷‍♂️ Nothing to update.")
        }
    }

                guard let script = frameworkScript else {
                    return
                }
                let linkedCarthageDynamicFrameworkNames = carthageDynamicFrameworks
                    .filter { information in
                        script.body.files.contains { $0.name == information.name }
                    }
                    .map { $0.name }

