Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mfazekas committed Oct 2, 2020
1 parent 2bf634d commit 1f44113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions react-native-mapbox-gl.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

rnmbgl_ios_version = $ReactNativeMapboxGLIOSVersion || ENV["REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION"] || '~> 5.8'
default_ios_mapbox_version = '~> 5.8'
rnmbgl_ios_version = $ReactNativeMapboxGLIOSVersion || ENV["REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION"] || default_ios_mapbox_version
if ENV.has_key?("REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION")
puts "REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION env is deprecated please use `$ReactNativeMapboxGLIOSVersion = \"#{rnmbgl_ios_version}\"`"
end
Expand All @@ -28,7 +29,7 @@ Pod::Spec.new do |s|
s.default_subspecs= ['DynamicLibrary']
else
s.subspec 'StaticLibraryFixer' do |sp|
if rnmbgl_ios_version.split('.')[0].to_i == 5
if rnmbgl_ios_version.split('.')[0] =~ /.*(\d+)/ && $1.to_i == 5
s.dependency '@react-native-mapbox-gl-mapbox-static', rnmbgl_ios_version
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/autogenerate.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function readIosVersion() {
'react-native-mapbox-gl.podspec',
);
const lines = fs.readFileSync(podspecPath, 'utf8').split('\n');
const mapboxLineRegex = /^REACT_NATIVE_MAPBOX_MAPBOX_IOS_VERSION.*||.+'~>\s+(\d+\.\d+)'$/;
const mapboxLineRegex = /^default_ios_mapbox_version\s*=\s*'~>\s+(\d+\.\d+)'$/;
const mapboxLine = lines.filter(i => mapboxLineRegex.exec(i))[0];
return `${mapboxLineRegex.exec(mapboxLine)[1]}.0`;
}
Expand Down

0 comments on commit 1f44113

Please sign in to comment.