Sha256: d90adcfd6e9fb8e073c59536a9a757e8b24a4845434320278978f8bf9bd1a15c

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 KB

Contents

require 'ios/module/setup/Template_Configurator'

require 'thor'

module App
    class IOS_CLI < Thor
        desc "module", "Create a new module to iOS platform"
        def module
        IOS::TemplateConfigurator.new.run
    end
    
    desc "install", "Install scripts and templates in project"
    def install
        puts "Verificando se existe Homebrew instalado"
        brewExists = system('which -s brew')
        if brewExists
            puts "Atualizando Homebrew"
            system('brew update')
        else
            puts "Instalando Homebrew"
            system("/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"")
        end
        puts "Instalando swiftgen"
        system("brew install swiftgen")
        
        puts "✅ Instalado com sucesso"

        install_hooks
    end
    
    private
    def install_hooks
        project_directory = Dir.pwd
        install_hooks_path = File.join(project_directory, 'install-hooks.rb')
        
        unless File.exist?(install_hooks_path)
            puts "O arquivo install-hooks.rb não foi encontrado em #{File.join(project_directory)}."
            return
        end
        
        puts "Executando install_hooks..."
        
        Dir.chdir(File.join(project_directory)) do
            success = system('ruby install-hooks.rb')
                if success
                    puts "✅ Hooks instalados com sucesso!"
                else
                    puts "❌ Erro ao executar pre-hook"
                end
            end
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shellboxCLI-0.1.16 lib/ios/iosOption.rb