shellboxCLI 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6ce7987bd00a9e2c74b25d0a9aec6b977488a6d41af3501f0fe483a05baa8bb
4
- data.tar.gz: 1d65b6fdb84c6f18775878b482f817f93dd6d96134182072067433aa09637af1
3
+ metadata.gz: b74de10a5741465d1c38a22d3b73610b38c44a74e5652b2eb9184b0607bb6591
4
+ data.tar.gz: 2af28a75e3e45cdb20abbb92b21c47da6835fa32451cd01c7746bcd785bea845
5
5
  SHA512:
6
- metadata.gz: a82818f1c8a443cdb1e8cdb0e43ecf0254cfd09bf14f64fe8553cde4ff5b095665f68b44640df6e6e16c1f6a2e442ddfeee17b6ac35a06259193ab726e742181
7
- data.tar.gz: 987131a34a9f176e94ef2c34494a9dd22c75ce0094cb4a49a8567304229760ec672db0e897046b645d19b67d29d1381f0fd90095591cc60a6d6411e557e3659f
6
+ metadata.gz: 49c7c7c6b71b2e9860a8a45275365ebdf5da763724d0b25caa07f58c8de63828042ae43f1f6273c0a43d943987cb14f259995ed8a2268400e69c04e49a362a57
7
+ data.tar.gz: 980b45872ec647a6707dd5444f61fd626bb84c2dbd3f9b28e145cc6f0a80d7ff3cc0fb07a22969884d3bc9dbbcd2e63c35f2f7ffd497893488da918c77ba9ce5
data/bin/install-hooks ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "ios/hooks/install-hooks"
4
+
5
+ App::ShellboxCLI.start
6
+
@@ -0,0 +1,13 @@
1
+ unless File.directory?(".git/hooks")
2
+ puts "Pasta .git/hooks não encontrada. Certifique-se de estar no diretório raiz do seu repositório Git."
3
+ exit 1
4
+ end
5
+
6
+ # Copia o pre-commit do CLI para a pasta .git/hooks do projeto
7
+ source_file = File.join(".hooks", "pre-commit")
8
+ destination_file = File.join(".git", "hooks", "pre-commit")
9
+
10
+ FileUtils.cp(source_file, destination_file)
11
+ File.chmod(0755, destination_file)
12
+
13
+ puts "Hook pre-commit configurado com sucesso no seu projeto local!"
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+
3
+ # Path para o Swiftlint
4
+ SWIFTLINT_PATH=/opt/homebrew/bin/swiftlint
5
+
6
+ # Verifica se o Swiftlint está instalado
7
+ if ! command -v $SWIFTLINT_PATH &> /dev/null; then
8
+ echo "Swiftlint não encontrado. Certifique-se de que está instalado."
9
+ exit 1
10
+ fi
11
+
12
+ # Obtém arquivos em diff que ainda não foram commitados
13
+ files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.swift$")
14
+
15
+ # Verifica se existem arquivos Swift para lint
16
+ if [ -n "$files" ]; then
17
+ echo "Executando Swiftlint nos arquivos alterados..."
18
+
19
+ # Executa o Swiftlint nos arquivos em diff
20
+ lint_output=$($SWIFTLINT_PATH lint --path $files)
21
+
22
+ if [ -n "$lint_output" ]; then
23
+ echo "Erros ou avisos do Swiftlint encontrados:"
24
+ echo "$lint_output"
25
+ echo "Corrija os problemas de lint antes de commitar."
26
+ exit 1
27
+ fi
28
+ fi
29
+
30
+ exit 0
data/lib/ios/iosOption.rb CHANGED
@@ -3,29 +3,40 @@ require 'ios/module/setup/Template_Configurator'
3
3
  require 'thor'
4
4
 
5
5
  module App
6
-
7
- class IOS_CLI < Thor
6
+
7
+ class IOS_CLI < Thor
8
8
  desc "module", "Create a new module to iOS platform"
9
9
  def module
10
- IOS::TemplateConfigurator.new.run
10
+ IOS::TemplateConfigurator.new.run
11
+ end
12
+
13
+ desc "install", "Install scripts and templates in project"
14
+ def install
15
+ puts "Verificando se existe Homebrew instalado"
16
+ brewExists = system('which -s brew')
17
+ if brewExists
18
+ puts "Atualizando Homebrew"
19
+ system('brew update')
20
+ else
21
+ puts "Instalando Homebrew"
22
+ system("/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"")
11
23
  end
24
+ puts "Instalando swiftgen"
25
+ system("brew install swiftgen")
26
+
27
+ puts "✅ Instalado com sucesso"
12
28
 
13
- desc "install", "Install scripts and templates in project"
14
- def install
15
- puts "Verificando se existe Homebrew instalado"
16
- brewExists = system('which -s brew')
17
- if brewExists
18
- puts "Atualizando Homebrew"
19
- system('brew update')
20
- else
21
- puts "Instalando Homebrew"
22
- system("/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"")
23
- end
24
- puts "Instalando swiftgen"
25
- system("brew install swiftgen")
29
+ install_hooks
30
+ end
26
31
 
27
- puts "✅ Instalado com sucesso"
28
- end
32
+ private
33
+
34
+ def install_hooks
35
+ puts "Executando install_hooks..."
36
+ system('ruby hooks/install-hooks.rb')
37
+ puts "✅ Hooks instalados com sucesso"
38
+ end
29
39
  end
40
+ end
30
41
 
31
- end
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shellboxCLI
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShellBox App
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-06 00:00:00.000000000 Z
11
+ date: 2023-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -57,11 +57,15 @@ email:
57
57
  - rodrigo.martins@raizen.com
58
58
  executables:
59
59
  - shellbox
60
+ - install-hooks
60
61
  extensions: []
61
62
  extra_rdoc_files: []
62
63
  files:
64
+ - bin/install-hooks
63
65
  - bin/shellbox
64
66
  - lib/ShellboxCLI.rb
67
+ - lib/ios/hooks/install-hooks.rb
68
+ - lib/ios/hooks/pre-commit
65
69
  - lib/ios/iosOption.rb
66
70
  - lib/ios/module/setup/ConfigureSwift.rb
67
71
  - lib/ios/module/setup/MessageBank.rb