Skip to content

Commit

Permalink
Address two comments from last week's PRs (#6774)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Oct 19, 2020
1 parent 5e681b5 commit c0fa09b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ReleaseTooling/Sources/FirebaseReleaser/Tags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enum Tags {

private static func createTag(gitRoot: URL, tag: String, deleteExistingTags: Bool) {
if deleteExistingTags {
verifyTagsAreSafeToDelete()
verifyTagsAreSafeToDelete(gitRoot: gitRoot)
Shell.executeCommand("git tag --delete \(tag)", workingDir: gitRoot)
Shell.executeCommand("git push --delete origin \(tag)", workingDir: gitRoot)
} else {
Expand All @@ -59,13 +59,17 @@ enum Tags {
/// delete a tag that is being used in production.
/// It works by checking for the existence of the corresponding Firebase podspec in the
/// clone of https://github.com/CocoaPods/Specs
private static func verifyTagsAreSafeToDelete() {
private static func verifyTagsAreSafeToDelete(gitRoot: URL) {
var homeDirURL: URL
if #available(OSX 10.12, *) {
homeDirURL = FileManager.default.homeDirectoryForCurrentUser
} else {
fatalError("Run on at least macOS 10.12")
}

// Make sure that local master spec repo is up to date.
Shell.executeCommand("pod repo update", workingDir: gitRoot)

let manifest = FirebaseManifest.shared
let firebasePublicURL = homeDirURL.appendingPathComponents(
[".cocoapods", "repos", "cocoapods", "Specs", "0", "3", "5", "Firebase"]
Expand Down
2 changes: 2 additions & 0 deletions ReleaseTooling/Sources/FirebaseReleaser/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ struct FirebaseReleaser: ParsableCommand {
transform: URL.init(fileURLWithPath:))
var gitRoot: URL

/// Log commands only and do not make any repository or source changes.
/// Useful for testing and for generating the list of push commands.
@Option(default: false,
help: "Log without executing the shell commands")
var logOnly: Bool
Expand Down

0 comments on commit c0fa09b

Please sign in to comment.