Skip to content

Commit bcc1083

Browse files
authored
Destinations: fix missing remove command message (#6319)
The `experimental-destination remove` subcommand has two conditions: removing by bundle name or artifact ID. Previously, on successful removal a message was printed only in one of the conditions, which was wrong. When removing a bundle by artifact ID absence of a printed message is confusing to the user and makes it unclear whether the command invocation had any effect. rdar://107138636
1 parent e3b6e5d commit bcc1083

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Sources/CrossCompilationDestinationsTool/RemoveDestination.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,11 @@ struct RemoveDestination: DestinationCommand {
3939
let destinationsDirectory = try self.getOrCreateDestinationsDirectory()
4040
let artifactBundleDirectory = destinationsDirectory.appending(component: self.destinationIDOrBundleName)
4141

42+
let removedBundleDirectory: AbsolutePath
4243
if fileSystem.exists(artifactBundleDirectory) {
4344
try fileSystem.removeFileTree(artifactBundleDirectory)
4445

45-
print(
46-
"""
47-
Destination artifact bundle at path `\(artifactBundleDirectory)` was successfully removed from the \
48-
file system.
49-
"""
50-
)
46+
removedBundleDirectory = artifactBundleDirectory
5147
} else {
5248
let bundles = try DestinationBundle.getAllValidBundles(
5349
destinationsDirectory: destinationsDirectory,
@@ -106,6 +102,14 @@ struct RemoveDestination: DestinationCommand {
106102
}
107103

108104
try fileSystem.removeFileTree(matchingBundle.path)
105+
removedBundleDirectory = matchingBundle.path
109106
}
107+
108+
print(
109+
"""
110+
Destination artifact bundle at path `\(removedBundleDirectory)` was successfully removed from the \
111+
file system.
112+
"""
113+
)
110114
}
111115
}

0 commit comments

Comments
 (0)