shellboxCLI 0.1.6 → 0.1.8

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: '08a1a9586065ab94d54895f4807e82b61d637f2ac8004ad23025bd77d541ef09'
4
+ data.tar.gz: eb74b74aa09cff2b0936a9fcbfe7953744c3b4b3a2bc53b9cd7aac9887274d20
5
5
  SHA512:
6
- metadata.gz: a82818f1c8a443cdb1e8cdb0e43ecf0254cfd09bf14f64fe8553cde4ff5b095665f68b44640df6e6e16c1f6a2e442ddfeee17b6ac35a06259193ab726e742181
7
- data.tar.gz: 987131a34a9f176e94ef2c34494a9dd22c75ce0094cb4a49a8567304229760ec672db0e897046b645d19b67d29d1381f0fd90095591cc60a6d6411e557e3659f
6
+ metadata.gz: 52de857020abaf650ad5bfc7ea64724497200e086a3cd632607a48b9735134a6ae788668a44737fe0b0fdd2d9f957a77295c6dce26c2656b6ac1a265cb24d75e
7
+ data.tar.gz: 43e79597b10ce6d28e258c83949bd2c1385d6958a2fb9473d3c6dd3a53d87b302c36b0f21eb126ef69ef8b6f287b29e57feafac048b10954c41cd5eda55b5aeb
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,12 @@
1
+ #!/bin/bash
2
+
3
+ if [ ! -d ".git/hooks" ]; then
4
+ echo "Pasta .git/hooks não encontrada. Certifique-se de estar no diretório raiz do seu repositório Git."
5
+ exit 1
6
+ fi
7
+
8
+ # Copia o pre-commit do CLI para a pasta .git/hooks do projeto
9
+ cp pre-commit .git/hooks/
10
+ chmod +x .git/hooks/pre-commit
11
+
12
+ echo "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,38 @@ 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
29
- end
32
+ private
30
33
 
31
- end
34
+ def install_hooks
35
+ puts "Executando install_hooks..."
36
+ system('ruby hooks/install-hooks.rb')
37
+ puts "✅ Hooks instalados com sucesso"
38
+ end
39
+ end
40
+ 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.8
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: 2024-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -57,11 +57,16 @@ 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/install-hooks.sh
69
+ - lib/ios/hooks/pre-commit
65
70
  - lib/ios/iosOption.rb
66
71
  - lib/ios/module/setup/ConfigureSwift.rb
67
72
  - lib/ios/module/setup/MessageBank.rb