Skip to content

Commit 09eda4e

Browse files
committed
Restore previous crawling version
1 parent ebba597 commit 09eda4e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

op-sqlite.podspec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ package_json_path = nil
1414
# When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite
1515
# Find the users package.json by searching up through parent directories
1616
if is_user_app
17-
current_dir = File.dirname(File.expand_path(__dir__))
17+
current_dir = File.expand_path(__dir__)
18+
# Move one level up to the parent directory
19+
current_dir = File.dirname(current_dir)
1820

21+
# Find the package.json by searching up through parent directories
1922
loop do
2023
package_path = File.join(current_dir, "package.json")
2124
if File.exist?(package_path)
2225
package_json_path = package_path
2326
break
2427
end
2528

26-
break if File.dirname(current_dir) == current_dir # reached filesystem root
29+
parent_dir = File.dirname(current_dir)
30+
break if parent_dir == current_dir # reached filesystem root
2731
current_dir = parent_dir
2832
end
2933

30-
raise "package.json not found? It's needed to read any op-sqlite config (if available)" if package_json_path.nil?
34+
raise "package.json not found" if package_json_path.nil?
3135
else
3236
package_json_path = File.join(__dir__, "example", "package.json")
3337
end

0 commit comments

Comments
 (0)