mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Resolve "fatal: not a git repository" error outside of git repositories
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e1eb938c9d
commit
ae07c53d0b
@@ -89,9 +89,9 @@ main() {
|
||||
|
||||
describe "Copying output to final directory"
|
||||
mkdir -p "$CODEGEN_COMPONENTS_OUTPUT_DIR" "$CODEGEN_MODULES_OUTPUT_DIR"
|
||||
cp -R "$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME.h" "$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME-generated.mm" "$CODEGEN_MODULES_OUTPUT_DIR" || exit 1
|
||||
cp -v -R "$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME.h" "$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME-generated.mm" "$CODEGEN_MODULES_OUTPUT_DIR" || exit 1
|
||||
find "$TEMP_OUTPUT_DIR" -type f | xargs sed -i.bak "s/$CODEGEN_MODULES_LIBRARY_NAME/$CODEGEN_COMPONENTS_LIBRARY_NAME/g" || exit 1
|
||||
find "$TEMP_OUTPUT_DIR" -type f -not -iname "$CODEGEN_MODULES_LIBRARY_NAME*" -exec cp '{}' "$CODEGEN_COMPONENTS_OUTPUT_DIR/" ';' || exit 1
|
||||
find "$TEMP_OUTPUT_DIR" -type f -not -iname "$CODEGEN_MODULES_LIBRARY_NAME*" -exec cp -v '{}' "$CODEGEN_COMPONENTS_OUTPUT_DIR/" ';' || exit 1
|
||||
|
||||
echo >&2 'Done.'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user