diff --git a/Sources/CliClient/CliClient+Commands.swift b/Sources/CliClient/CliClient+Commands.swift index bbe222d..1c58320 100644 --- a/Sources/CliClient/CliClient+Commands.swift +++ b/Sources/CliClient/CliClient+Commands.swift @@ -23,14 +23,18 @@ public extension CliClient { try await runCommand(quiet: quiet, shell: shell, args) } - func installDependencies() async throws { + func installDependencies( + quiet: Bool = false, + shell: String? = nil + ) async throws { guard let url = Bundle.module.url(forResource: "Brewfile", withExtension: nil) else { throw CliClientError.brewfileNotFound } try await runCommand( - quiet: false, - shell: .zsh(useDashC: true), - "brew", "bundle", "--file", url.cleanFilePath + quiet: quiet, + shell: shell.orDefault, + "brew", "bundle", + "--file", url.cleanFilePath ) } diff --git a/Sources/CliClient/Resources/Brewfile b/Sources/CliClient/Resources/Brewfile index 8c06148..503b8d3 100644 --- a/Sources/CliClient/Resources/Brewfile +++ b/Sources/CliClient/Resources/Brewfile @@ -1,4 +1,4 @@ brew "ansible" brew "imagemagick" -cask "mactex-no-gui" brew "pandoc" +brew "texlive" diff --git a/Sources/hpa/UtilsCommands/InstallDependenciesCommand.swift b/Sources/hpa/UtilsCommands/InstallDependenciesCommand.swift index 8a2eb29..304f96d 100644 --- a/Sources/hpa/UtilsCommands/InstallDependenciesCommand.swift +++ b/Sources/hpa/UtilsCommands/InstallDependenciesCommand.swift @@ -10,14 +10,26 @@ struct InstallDependenciesCommand: AsyncParsableCommand { commandName: commandName, abstract: createAbstract("Ensure required dependencies are installed"), discussion: Discussion { - Note { - "Homebrew is required to install dependencies." + VStack { + Note { + "Homebrew is required to install dependencies." + } + HStack { + "See Also:".yellow.bold.underline + "https://brew.sh" + } } + .separator(.newLine(count: 2)) } ) - func run() async throws { + @OptionGroup var globals: BasicGlobalOptions + + mutating func run() async throws { @Dependency(\.cliClient) var cliClient - try await cliClient.installDependencies() + try await cliClient.installDependencies( + quiet: globals.quiet, + shell: globals.shell + ) } }