shellboxCLI 0.1.9 → 0.1.11

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: b177cbce7350d43ceab5ce3c4fed9fd610d0a5bb82fb8e57360fd47b829d0b77
4
- data.tar.gz: 82e9cfe8fe8ed2fa515c41cffdb21b7dceae094659e8210875dc23c14e80675d
3
+ metadata.gz: 4a2bd2e0c216bf8c0f31eb7c8f7ffce01b87a1ebe0760d590e0ba172c60206c4
4
+ data.tar.gz: aec60db021212810afdf79e6f3c6896c035574782fc14de04d476464f46ec189
5
5
  SHA512:
6
- metadata.gz: 229d8d7c1658cf9c8ebd4a13516b416199874d88f3c070cd12b15455270e84a0771972786edb80f4999c3b1cc798e5b8b7ab29b80aa0208aa9b1b886abd1317b
7
- data.tar.gz: 280ca136f13288688e244ec63bddc9c51d716c90f05760898d94669f75cae3ab1b72d21ac3287f525bdc8d827f12cc4b75c4e1b729c0331ab92b632af58958eb
6
+ metadata.gz: a54dd4b45679fe70d233baf16770a4ed11e75ab281817dfecea2e7c57bec99e24da18eab13294c5bf10d9d250773732325421696cb8344055fd529eec46a16e7
7
+ data.tar.gz: 5d00d3d162ef095675afbf5a5639bacebaa9de6f9dea15a2e29ffdde68a0005e4d3b4df8059d22d34420c456c5da19910e2e464479de3303711214ac1b46e70e
@@ -1,24 +1,24 @@
1
1
  #!/bin/bash
2
-
2
+
3
3
  # Path para o Swiftlint
4
4
  SWIFTLINT_PATH=/opt/homebrew/bin/swiftlint
5
-
5
+
6
6
  # Verifica se o Swiftlint está instalado
7
7
  if ! command -v $SWIFTLINT_PATH &> /dev/null; then
8
8
  echo "Swiftlint não encontrado. Certifique-se de que está instalado."
9
9
  exit 1
10
10
  fi
11
-
11
+
12
12
  # Obtém arquivos em diff que ainda não foram commitados
13
13
  files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.swift$")
14
-
14
+
15
15
  # Verifica se existem arquivos Swift para lint
16
16
  if [ -n "$files" ]; then
17
17
  echo "Executando Swiftlint nos arquivos alterados..."
18
-
18
+
19
19
  # Executa o Swiftlint nos arquivos em diff
20
20
  lint_output=$($SWIFTLINT_PATH lint --path $files)
21
-
21
+
22
22
  if [ -n "$lint_output" ]; then
23
23
  echo "Erros ou avisos do Swiftlint encontrados:"
24
24
  echo "$lint_output"
@@ -26,5 +26,5 @@ if [ -n "$files" ]; then
26
26
  exit 1
27
27
  fi
28
28
  fi
29
-
29
+
30
30
  exit 0
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'fileutils'
5
+
6
+ current_directory = Dir.pwd
7
+ script_directory = File.dirname(File.expand_path(__FILE__))
8
+
9
+ # Certifica-se de estar no diretório raiz do repositório Git
10
+ git_directory = File.join(current_directory, ".git")
11
+ unless File.directory?(git_directory)
12
+ puts "Pasta .git não encontrada. Certifique-se de estar no diretório raiz do seu repositório Git."
13
+ exit 1
14
+ end
15
+
16
+ source_file = File.join(script_directory, "hooks", "pre-commit")
17
+ destination_file = File.join(git_directory, "hooks", "pre-commit")
18
+
19
+ # Copia script pre-commit do CLI para a pasta .git/hooks do projeto
20
+ FileUtils.cp(source_file, destination_file)
21
+ File.chmod(0755, destination_file)
22
+
23
+ puts "Hook pre-commit configurado com sucesso!"
data/lib/ios/iosOption.rb CHANGED
@@ -3,7 +3,6 @@ require 'ios/module/setup/Template_Configurator'
3
3
  require 'thor'
4
4
 
5
5
  module App
6
-
7
6
  class IOS_CLI < Thor
8
7
  desc "module", "Create a new module to iOS platform"
9
8
  def module
@@ -32,9 +31,25 @@ module App
32
31
  private
33
32
 
34
33
  def install_hooks
34
+ hooks_directory = File.expand_path(File.join(File.dirname(__FILE__), 'hooks'))
35
+ install_hooks_path = File.join(hooks_directory, 'install-hooks.rb')
36
+
37
+ unless File.exist?(install_hooks_path)
38
+ puts "O arquivo install-hooks.rb não foi encontrado em #{hooks_directory}."
39
+ return
40
+ end
41
+
35
42
  puts "Executando install_hooks..."
36
- system('ruby hooks/install-hooks.rb')
37
- puts "✅ Hooks instalados com sucesso"
43
+
44
+ Dir.chdir(hooks_directory) do
45
+ success = system('ruby install-hooks.rb')
46
+
47
+ if success
48
+ puts "✅ Hooks instalados com sucesso!"
49
+ else
50
+ puts "❌ Erro ao executar pre-hook"
51
+ end
52
+ end
38
53
  end
39
54
  end
40
55
  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.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShellBox App
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -64,8 +64,8 @@ files:
64
64
  - bin/install-hooks
65
65
  - bin/shellbox
66
66
  - lib/ShellboxCLI.rb
67
- - lib/ios/hooks/install-hooks.rb
68
67
  - lib/ios/hooks/pre-commit
68
+ - lib/ios/install-hooks.rb
69
69
  - lib/ios/iosOption.rb
70
70
  - lib/ios/module/setup/ConfigureSwift.rb
71
71
  - lib/ios/module/setup/MessageBank.rb
@@ -1,13 +0,0 @@
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!"