                         }
                     }
                     if scriptHasBeenUpdated {
-                        projectHasBeenUpdated = true
+                        needUpdateProject = 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 projectHasBeenUpdated = false

        let filteredTargets = project.targets
            .filter { target in

        if let targetName = targetName, filteredTargets.isEmpty {
            throw Error.targetFilterFailed(name: targetName)
        }

        let carthageDynamicFrameworks = try frameworksInformation()
            .filter { information in
                information.linking == .dynamic
            }

        try filteredTargets
            .forEach { target in
