neeto-translate-cli 0.2.8 → 0.2.10
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aa22aafd84257f4fa8d4e00ccf6f334c28a3e392bc38d69f10084c56a4052110
|
|
4
|
+
data.tar.gz: 3675d04113ee53f2780901e5c997c5a7e1894d347eb6de34f82f0f3fac5f1175
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 179fa29d565045d79403d6a29439158232625c7b5f03539d3a1af57c9867fe25cee68be14ffd738cb9ef1584ab4c22fd5eda5a1e7a0e50f1c0d656112ffa34e3
|
|
7
|
+
data.tar.gz: 9e67cfa18e53493d644d3e82b0464cce9f2c89bbe9372e9ee986b960d916e1aafb1258111d2afc4baa64af9b4aad687fb1cd8cb19e17b375287539cecbdae5fb
|
|
@@ -35,15 +35,66 @@ module NeetoTranslateCli
|
|
|
35
35
|
private
|
|
36
36
|
|
|
37
37
|
def git_commit_id
|
|
38
|
-
|
|
38
|
+
puts "DEBUG: Current working directory: #{Dir.pwd}"
|
|
39
|
+
puts "DEBUG: Git repository root: #{`git rev-parse --show-toplevel`.strip}"
|
|
40
|
+
puts "DEBUG: Current branch: #{`git branch --show-current`.strip}"
|
|
41
|
+
puts "DEBUG: Recent commits:"
|
|
42
|
+
puts `git log --oneline -5`
|
|
43
|
+
puts "DEBUG: Searching for commits with '[neeto-translate]' in message..."
|
|
44
|
+
|
|
45
|
+
# Try different variations of the grep pattern
|
|
46
|
+
puts "DEBUG: Trying exact match:"
|
|
47
|
+
result1 = `git log --grep="[neeto-translate]" --fixed-strings -n 1 --pretty=format:"%H"`.strip
|
|
48
|
+
puts "DEBUG: Result 1 (exact): '#{result1}'"
|
|
49
|
+
|
|
50
|
+
puts "DEBUG: Trying without fixed-strings:"
|
|
51
|
+
result2 = `git log --grep="neeto-translate" -n 1 --pretty=format:"%H"`.strip
|
|
52
|
+
puts "DEBUG: Result 2 (without fixed-strings): '#{result2}'"
|
|
53
|
+
|
|
54
|
+
puts "DEBUG: Trying with case insensitive:"
|
|
55
|
+
result3 = `git log --grep="neeto-translate" -i -n 1 --pretty=format:"%H"`.strip
|
|
56
|
+
puts "DEBUG: Result 3 (case insensitive): '#{result3}'"
|
|
57
|
+
|
|
58
|
+
puts "DEBUG: All commits with 'neeto' in message:"
|
|
59
|
+
puts `git log --grep="neeto" --oneline`
|
|
60
|
+
|
|
61
|
+
puts "DEBUG: All commits with 'translate' in message:"
|
|
62
|
+
puts `git log --grep="translate" --oneline`
|
|
63
|
+
|
|
64
|
+
# Return the first non-empty result
|
|
65
|
+
final_result = result1.empty? ? (result2.empty? ? result3 : result2) : result1
|
|
66
|
+
puts "DEBUG: Final commit id: '#{final_result}'"
|
|
67
|
+
final_result
|
|
39
68
|
end
|
|
40
69
|
|
|
41
70
|
def find_updated_keys(commit_id)
|
|
42
71
|
updated_frontend_keys = []
|
|
72
|
+
|
|
73
|
+
# Debug: Log the commit_id and current working directory
|
|
74
|
+
puts "DEBUG: commit_id = '#{commit_id}'"
|
|
75
|
+
puts "DEBUG: current working directory = '#{Dir.pwd}'"
|
|
76
|
+
puts "DEBUG: frontend path = '#{options[:frontend]}'"
|
|
77
|
+
|
|
43
78
|
frontend_translations[:en].each do |file_path, content|
|
|
44
79
|
lang_file_path = "#{options[:frontend]}/en/#{file_path}.json"
|
|
45
80
|
relative_path_from_pwd = Pathname.new(lang_file_path).to_s
|
|
46
|
-
|
|
81
|
+
|
|
82
|
+
# Debug: Log the paths being used
|
|
83
|
+
puts "DEBUG: file_path = '#{file_path}'"
|
|
84
|
+
puts "DEBUG: lang_file_path = '#{lang_file_path}'"
|
|
85
|
+
puts "DEBUG: relative_path_from_pwd = '#{relative_path_from_pwd}'"
|
|
86
|
+
|
|
87
|
+
# Debug: Check if file exists
|
|
88
|
+
puts "DEBUG: file exists? #{File.exist?(relative_path_from_pwd)}"
|
|
89
|
+
|
|
90
|
+
# Debug: Try the git show command and log the result
|
|
91
|
+
git_command = "git show #{commit_id}:#{relative_path_from_pwd}"
|
|
92
|
+
puts "DEBUG: running git command: #{git_command}"
|
|
93
|
+
|
|
94
|
+
previous_content = `#{git_command}`
|
|
95
|
+
puts "DEBUG: git show result length = #{previous_content.length}"
|
|
96
|
+
puts "DEBUG: git show result (first 100 chars) = '#{previous_content[0..99]}'"
|
|
97
|
+
|
|
47
98
|
next if previous_content.empty?
|
|
48
99
|
|
|
49
100
|
previous_json = JSON.parse(previous_content)
|
|
@@ -54,11 +105,14 @@ module NeetoTranslateCli
|
|
|
54
105
|
flat_previous_json.key?(key) && flat_current_json[key] != flat_previous_json[key]
|
|
55
106
|
end
|
|
56
107
|
|
|
108
|
+
puts "DEBUG: updated_keys_for_file = #{updated_keys_for_file}"
|
|
109
|
+
|
|
57
110
|
next if updated_keys_for_file.empty?
|
|
58
111
|
|
|
59
112
|
updated_frontend_keys.concat(updated_keys_for_file.map { |key| "#{file_path}::#{key}" })
|
|
60
113
|
end
|
|
61
114
|
|
|
115
|
+
puts "DEBUG: final updated_frontend_keys = #{updated_frontend_keys}"
|
|
62
116
|
updated_frontend_keys
|
|
63
117
|
end
|
|
64
118
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: neeto-translate-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abhay V Ashokan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|