- echo "}" >> /tmp/lightning-persist-crate-source.txt
- cat /tmp/lightning-persist-crate-source.txt >> /tmp/lightning-crate-source.txt
- rm /tmp/lightning-persist-crate-source.txt
-fi
+ echo "}" >> /tmp/$1-crate-source.txt
+ cat /tmp/$1-crate-source.txt >> /tmp/crate-source.txt
+ rm /tmp/$1-crate-source.txt
+ if [ "$HOST_PLATFORM" = "host: x86_64-apple-darwin" ]; then
+ # OSX sed is for some reason not compatible with GNU sed
+ sed -E -i '' 's|#?'$1' = \{ .*|'$1' = \{ path = "'"$LIGHTNING_PATH"'/'$1'" '"$4"' }|' lightning-c-bindings/Cargo.toml
+ else
+ sed -E -i 's|#?'$1' = \{ .*|'$1' = \{ path = "'"$LIGHTNING_PATH"'/'$1'" '"$4"' }|' lightning-c-bindings/Cargo.toml
+ fi
+}