mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
ae07c53d0b
Summary: CocoaPods will display a "fatal: not a git repository" when these podspecs are consumed within Facebook's internal Mercurial repository due to the reliance on `git` to obtain the current commit hash. In these cases, the podspec is being consumed locally and the commit hash is unnecessary. The error is removed by avoiding the use of `git` if the current working directory is not a git repository (or any of the parent directories). Changelog: [Internal] [iOS] - Remove CocoaPods error within Facebook's repository Reviewed By: fkgozali Differential Revision: D27750974 fbshipit-source-id: 99159611c580baf5526f116948c5ff60e1c02e5c
32 lines
1.1 KiB
Ruby
32 lines
1.1 KiB
Ruby
# Copyright (c) Facebook, Inc. and its affiliates.
|
||
#
|
||
# This source code is licensed under the MIT license found in the
|
||
# LICENSE file in the root directory of this source tree.
|
||
|
||
require "json"
|
||
|
||
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
|
||
version = package['version']
|
||
|
||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||
if version == '1000.0.0'
|
||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
||
else
|
||
source[:tag] = "v#{version}"
|
||
end
|
||
|
||
Pod::Spec.new do |s|
|
||
s.name = "FBLazyVector"
|
||
s.version = version
|
||
s.summary = "-" # TODO
|
||
s.homepage = "https://reactnative.dev/"
|
||
s.license = package["license"]
|
||
s.author = "Facebook, Inc. and its affiliates"
|
||
s.platforms = { :ios => "11.0" }
|
||
s.source = source
|
||
s.source_files = "**/*.{c,h,m,mm,cpp}"
|
||
s.header_dir = "FBLazyVector"
|
||
|
||
end
|