2023-02-10 14:04:00 +01:00
|
|
|
import ArgumentParser
|
2024-05-15 10:37:44 +01:00
|
|
|
import CommandLineTools
|
2023-02-10 14:04:00 +01:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct SetupProject: ParsableCommand {
|
|
|
|
static var configuration = CommandConfiguration(abstract: "A tool to setup the required components to efficiently run and contribute to Element X iOS")
|
|
|
|
|
|
|
|
func run() throws {
|
|
|
|
try setupGitHooks()
|
2024-08-06 12:39:37 +01:00
|
|
|
try brewInstall()
|
2023-04-12 12:03:11 +02:00
|
|
|
try mintPackagesInstall()
|
2023-02-10 14:04:00 +01:00
|
|
|
try xcodegen()
|
|
|
|
}
|
|
|
|
|
|
|
|
func setupGitHooks() throws {
|
2024-05-15 10:37:44 +01:00
|
|
|
try Zsh.run(command: "git config core.hooksPath .githooks")
|
2023-02-10 14:04:00 +01:00
|
|
|
}
|
|
|
|
|
2024-08-06 12:39:37 +01:00
|
|
|
func brewInstall() throws {
|
2025-02-13 16:01:01 +00:00
|
|
|
try Zsh.run(command: "brew install xcodegen swiftgen swiftformat git-lfs sourcery mint pkl kiliankoe/formulae/swift-outdated localazy/tools/localazy peripheryapp/periphery/periphery FelixHerrmann/tap/swift-package-list")
|
2023-04-12 12:03:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func mintPackagesInstall() throws {
|
2024-05-15 10:37:44 +01:00
|
|
|
try Zsh.run(command: "mint install Asana/locheck")
|
2023-02-10 14:04:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func xcodegen() throws {
|
2024-05-15 10:37:44 +01:00
|
|
|
try Zsh.run(command: "xcodegen")
|
2023-02-10 14:04:00 +01:00
|
|
|
}
|
|
|
|
}
|