@op-engineering/op-sqlite 15.1.5 → 15.1.6
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.
- package/op-sqlite.podspec +7 -3
- package/package.json +1 -1
package/op-sqlite.podspec
CHANGED
|
@@ -14,8 +14,11 @@ package_json_path = nil
|
|
|
14
14
|
# When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite
|
|
15
15
|
# Find the users package.json by searching up through parent directories
|
|
16
16
|
if is_user_app
|
|
17
|
-
current_dir = File.
|
|
17
|
+
current_dir = File.expand_path(__dir__)
|
|
18
|
+
# Move one level up to the parent directory
|
|
19
|
+
current_dir = File.dirname(current_dir)
|
|
18
20
|
|
|
21
|
+
# Find the package.json by searching up through parent directories
|
|
19
22
|
loop do
|
|
20
23
|
package_path = File.join(current_dir, "package.json")
|
|
21
24
|
if File.exist?(package_path)
|
|
@@ -23,11 +26,12 @@ if is_user_app
|
|
|
23
26
|
break
|
|
24
27
|
end
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
parent_dir = File.dirname(current_dir)
|
|
30
|
+
break if parent_dir == current_dir # reached filesystem root
|
|
27
31
|
current_dir = parent_dir
|
|
28
32
|
end
|
|
29
33
|
|
|
30
|
-
raise "package.json not found
|
|
34
|
+
raise "package.json not found" if package_json_path.nil?
|
|
31
35
|
else
|
|
32
36
|
package_json_path = File.join(__dir__, "example", "package.json")
|
|
33
37
|
end
|