mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:11:45 +00:00
Automatically open a PR to bump the calver (#4167)
* Update our tools package to Swift 6.1
Also improves the package layout with subdirectories 📁
* Update GenerateSDKMocks to be an Async command.
* Add a tool to bump the project CalVer every month.
* Add a workflow to automatically bump the calendar version.
Note: This only does year & month, the patch is handled by the release script.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import ArgumentParser
|
||||
import CommandLineTools
|
||||
import Foundation
|
||||
|
||||
struct Locheck: ParsableCommand {
|
||||
enum LocheckError: LocalizedError {
|
||||
case missingMint
|
||||
case outputError
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case .missingMint:
|
||||
return "💥 Unable to find mint. Fix by running:\nbrew install mint\n"
|
||||
case .outputError:
|
||||
return "💥 Failed to read the output from locheck."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static let configuration = CommandConfiguration(abstract: "A tool that verifies bad strings contained in localization files")
|
||||
|
||||
private var stringsDirectoryURL: URL {
|
||||
.projectDirectory.appendingPathComponent("ElementX/Resources/Localizations")
|
||||
}
|
||||
|
||||
func run() throws {
|
||||
try checkMint()
|
||||
try checkStrings()
|
||||
}
|
||||
|
||||
func checkStrings() throws {
|
||||
guard let output = try Zsh.run(command: "mint run locheck discoverlproj --ignore-missing --ignore lproj_file_missing_from_translation --treat-warnings-as-errors \(stringsDirectoryURL.path)") else {
|
||||
throw LocheckError.missingMint
|
||||
}
|
||||
print(output)
|
||||
}
|
||||
|
||||
private func checkMint() throws {
|
||||
let result = try Zsh.run(command: "which mint")
|
||||
|
||||
if result?.contains("not found") == true {
|
||||
throw LocheckError.missingMint
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user