blob: bfcef00e0b1eb598af1ffdd6974185a638a10c1a [file] [log] [blame]
#!/bin/bash
# $1 Path to the new version.
# $2 Path to the old version.
set -x
set -e
# Change src/link.rs to include files from ../out/
SRCFILE=src/link.rs
OLDSTR='include!(concat!(env!("OUT_DIR"), "/common.rs"));'
NEWSTR='include!("../out/common.rs");'
sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
# Make sure that sed replaced $OLDSTR with $NEWSTR
grep "$NEWSTR" $SRCFILE > /dev/null
OLDSTR='include!(concat!(env!("OUT_DIR"), "/dynamic.rs"));'
NEWSTR='include!("../out/dynamic.rs");'
sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
# Make sure that sed replaced $OLDSTR with $NEWSTR
grep "$NEWSTR" $SRCFILE > /dev/null