Skip to content

Commit 97830ea

Browse files
author
Artem Novichkov
committed
Merge branch 'develop'
2 parents 2f5b740 + d321e68 commit 97830ea

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

Sources/CartingCore/Carting.swift

+17-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,23 @@ public final class Carting {
4949
type: .output)
5050

5151
if let carthage = carthageScript {
52-
carthage.body.inputPaths = inputPathsString
53-
carthage.body.outputPaths = outputPathsString
54-
carthage.body.shellScript = Keys.carthageScript
55-
print("✅ Script \"\(carthageScriptName)\" in target \"\(target.name)\" was successfully updated.")
56-
projectHasBeenUpdated = true
52+
var scriptHasBeenUpdated = false
53+
if carthage.body.inputPaths != inputPathsString {
54+
carthage.body.inputPaths = inputPathsString
55+
scriptHasBeenUpdated = true
56+
}
57+
if carthage.body.outputPaths != outputPathsString {
58+
carthage.body.outputPaths = outputPathsString
59+
scriptHasBeenUpdated = true
60+
}
61+
if carthage.body.shellScript != Keys.carthageScript {
62+
carthage.body.shellScript = Keys.carthageScript
63+
scriptHasBeenUpdated = true
64+
}
65+
if scriptHasBeenUpdated {
66+
projectHasBeenUpdated = true
67+
print("✅ Script \"\(carthageScriptName)\" in target \"\(target.name)\" was successfully updated.")
68+
}
5769
}
5870
else if linkedCarthageFrameworkNames.count > 0 {
5971
let body = ScriptBody(inputPaths: inputPathsString,

Sources/CartingCore/Models/ScriptBody.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ final class ScriptBody: BaseScriptBody {
3030
components.append(.tripleTab + "outputPaths = \(outputPaths);")
3131
components.append(.tripleTab + "runOnlyForDeploymentPostprocessing = \(runOnlyForDeploymentPostprocessing);")
3232
components.append(.tripleTab + "shellPath = \(shellPath);")
33-
components.append(.tripleTab + "shellScript = \(shellScript);")
3433
if let showEnvVarsInLog = showEnvVarsInLog {
34+
components.append(.tripleTab + "shellScript = \(shellScript);")
3535
components.append(.tripleTab + "showEnvVarsInLog = \(showEnvVarsInLog);\n")
3636
}
37+
else {
38+
components.append(.tripleTab + "shellScript = \(shellScript);\n")
39+
}
3740
return components.joined(separator: "\n")
3841
}
3942

0 commit comments

Comments
 (0)