shellboxCLI 0.1.10 → 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 +4 -4
- data/lib/ios/hooks/pre-commit +7 -7
- data/lib/ios/install-hooks.rb +23 -0
- metadata +3 -3
- data/lib/ios/hooks/install-hooks.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a2bd2e0c216bf8c0f31eb7c8f7ffce01b87a1ebe0760d590e0ba172c60206c4
|
4
|
+
data.tar.gz: aec60db021212810afdf79e6f3c6896c035574782fc14de04d476464f46ec189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a54dd4b45679fe70d233baf16770a4ed11e75ab281817dfecea2e7c57bec99e24da18eab13294c5bf10d9d250773732325421696cb8344055fd529eec46a16e7
|
7
|
+
data.tar.gz: 5d00d3d162ef095675afbf5a5639bacebaa9de6f9dea15a2e29ffdde68a0005e4d3b4df8059d22d34420c456c5da19910e2e464479de3303711214ac1b46e70e
|
data/lib/ios/hooks/pre-commit
CHANGED
@@ -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!"
|
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.
|
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-
|
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,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
unless File.directory?(".git/hooks")
|
4
|
-
puts "Pasta .git/hooks não encontrada. Certifique-se de estar no diretório raiz do seu repositório Git."
|
5
|
-
exit 1
|
6
|
-
end
|
7
|
-
|
8
|
-
# Copia o pre-commit do CLI para a pasta .git/hooks do projeto
|
9
|
-
source_file = File.join(".hooks", "pre-commit")
|
10
|
-
destination_file = File.join(".git", "hooks", "pre-commit")
|
11
|
-
|
12
|
-
FileUtils.cp(source_file, destination_file)
|
13
|
-
File.chmod(0755, destination_file)
|
14
|
-
|
15
|
-
puts "Hook pre-commit configurado com sucesso!"
|