expo-modules-autolinking 0.10.0 → 0.10.1

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/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.10.1 — 2022-07-25
14
+
15
+ ### 🎉 New features
16
+
17
+ - Added a feature to automatically generate `.xcode.env.local` with correct `$NODE_BINARY` path when running `pod install`. ([#18330](https://github.com/expo/expo/pull/18330) by [@kudo](https://github.com/kudo))
18
+
13
19
  ## 0.10.0 — 2022-07-07
14
20
 
15
21
  ### 🐛 Bug fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-autolinking",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Scripts that autolink Expo modules.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -48,5 +48,5 @@
48
48
  "find-up": "^5.0.0",
49
49
  "fs-extra": "^9.1.0"
50
50
  },
51
- "gitHead": "6e131f2da851a47c3a24eb3d6fc971a1a7822086"
51
+ "gitHead": "066000e04629874e1c67f2b3b9a38af805d9831c"
52
52
  }
@@ -0,0 +1,21 @@
1
+ require 'open3'
2
+ require 'pathname'
3
+
4
+
5
+ def maybe_generate_xcode_env_file!()
6
+ project_directory = Pod::Config.instance.project_root
7
+ xcode_env_file = File.join(project_directory, '.xcode.env.local')
8
+ if File.exists?(xcode_env_file)
9
+ return
10
+ end
11
+
12
+ # Adding the meta character `;` at the end of command for Ruby `Kernel.exec` to execute the command in shell.
13
+ stdout, stderr, status = Open3.capture3('command -v node;')
14
+ node_path = stdout.strip
15
+ if !stderr.empty? || status.exitstatus != 0 || node_path.empty?
16
+ Pod::UI.warn "Unable to generate `.xcode.env.local` for Node.js binary path: #{stderr}"
17
+ else
18
+ Pod::UI.info "Auto-generating `.xcode.env.local` with $NODE_BINARY=#{node_path}"
19
+ File.write(xcode_env_file, "export NODE_BINARY=\"#{node_path}\"\n")
20
+ end
21
+ end