2020-04-26 12:40:06 +00:00
|
|
|
{ lib, mkShell, status-go }:
|
2019-11-29 10:20:08 +00:00
|
|
|
|
2020-01-08 14:41:07 +00:00
|
|
|
let
|
2019-11-29 10:20:08 +00:00
|
|
|
shell = mkShell {
|
|
|
|
shellHook = ''
|
2020-01-08 14:41:07 +00:00
|
|
|
if [ -z "$STATUS_GO_IOS_LIBDIR" ]; then
|
|
|
|
echo "STATUS_GO_IOS_LIBDIR is not defined! Aborting."
|
2019-11-29 10:20:08 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
RCTSTATUS_DIR="$STATUS_REACT_HOME/modules/react-native-status/ios/RCTStatus"
|
|
|
|
targetBasename='Statusgo.framework'
|
|
|
|
|
|
|
|
# Compare target folder with source to see if copying is required
|
|
|
|
if [ -d "$RCTSTATUS_DIR/$targetBasename" ] && [ -d $STATUS_REACT_HOME/ios/Pods/ ] && \
|
2020-01-08 14:41:07 +00:00
|
|
|
diff -q --no-dereference --recursive $RCTSTATUS_DIR/$targetBasename/ $STATUS_GO_IOS_LIBDIR/ > /dev/null; then
|
2019-11-29 10:20:08 +00:00
|
|
|
echo "$RCTSTATUS_DIR/$targetBasename already in place"
|
|
|
|
else
|
2020-01-08 14:41:07 +00:00
|
|
|
sourceBasename="$(basename $STATUS_GO_IOS_LIBDIR)"
|
2019-11-29 10:20:08 +00:00
|
|
|
echo "Copying $sourceBasename from Nix store to $RCTSTATUS_DIR"
|
|
|
|
rm -rf "$RCTSTATUS_DIR/$targetBasename/"
|
2020-01-08 14:41:07 +00:00
|
|
|
cp -a $STATUS_GO_IOS_LIBDIR $RCTSTATUS_DIR
|
2019-11-29 10:20:08 +00:00
|
|
|
chmod -R 755 "$RCTSTATUS_DIR/$targetBasename"
|
|
|
|
if [ "$sourceBasename" != "$targetBasename" ]; then
|
|
|
|
mv "$RCTSTATUS_DIR/$sourceBasename" "$RCTSTATUS_DIR/$targetBasename"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
};
|
2020-01-08 14:41:07 +00:00
|
|
|
in
|
2020-04-26 12:40:06 +00:00
|
|
|
lib.mergeSh status-go.shell [ shell ]
|