Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address two comments from last week's PRs #6774

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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