Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Compatibility issues with osx and unix platforms around the sed #217

Merged
merged 1 commit into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions externals/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ anoncredsNewCommit=$(git submodule | grep $AnonCreds | awk '{print $1}')
anoncredsOldCommit=$(cat "${ExternalsDir}/${AnonCreds}.commit" 2>/dev/null)
anoncredsRequired=$?

is_mac() {
[[ "$OSTYPE" == "darwin"* ]]
}

buildDIDComm() {
echo "Build DIDComm"
Expand All @@ -39,7 +42,11 @@ buildDIDComm() {
#This code fails on browser when wasm is first loaded, it can just be ignored
#The code will fully work
cd "${GenDIDComm}-wasm-browser"
sed -i '' "/if (typeof input === 'undefined') {/,/}/d" didcomm_js.js
if is_mac; then
sed -i '' "/if (typeof input === 'undefined') {/,/}/d" didcomm_js.js
else
sed -i "/if (typeof input === 'undefined') {/,/}/d" didcomm_js.js
fi

cd $ExternalsDir
git submodule | grep $DIDComm | awk '{print $1}' > "./${DIDComm}.commit"
Expand All @@ -64,8 +71,11 @@ buildAnonCreds() {
#This code fails on browser when wasm is first loaded, it can just be ignored
#The code will fully work
cd "${GenAnonCreds}-wasm-browser"
sed -i '' "/if (typeof input === 'undefined') {/,/}/d" "./${AnonCreds}.js"

if is_mac; then
sed -i '' "/if (typeof input === 'undefined') {/,/}/d" "./${AnonCreds}.js"
else
sed -i "/if (typeof input === 'undefined') {/,/}/d" "./${AnonCreds}.js"
fi
cd $ExternalsDir
git submodule | grep $AnonCreds | awk '{print $1}' > "./${AnonCreds}.commit"
}
Expand Down
Loading