Starcounter-Jack / JSON-Patch

Lean and mean Javascript implementation of the JSON-Patch standard (RFC 6902). Update JSON documents using delta patches.
MIT License
1.79k stars 215 forks source link

Build script doesn't work for OS X due to differences between `sed` in OS X and Linux. #244

Open jaylattice opened 4 years ago

jaylattice commented 4 years ago

Title explains everything, StackOverflow elaborates: https://stackoverflow.com/questions/16745988/sed-command-with-i-option-in-place-editing-works-fine-on-ubuntu-but-not-mac

I'm not really interested in submitting a PR for this, since it's not a huge concern for me. I just thought anyone else who wanted to build your package locally on OS X would want to know about this. Thank you for this library.

Starcounter-Jack commented 4 years ago

Thanks for the information. I will look into this.

libreninja commented 3 years ago

@Starcounter-Jack I have tested a change to tsc-to-mjs.sh which resolves the problem for me on macos.

!/bin/bash
cd module
mv core.js core.mjs && mv duplex.js duplex.mjs && mv helpers.js helpers.mjs

if [[ "$OSTYPE" == "darwin"* ]]; then
    sed -i '' 's/\.js/\.mjs/g' duplex.mjs core.mjs
else
    sed -i 's/\.js/\.mjs/g' duplex.mjs core.mjs
fi

I will submit a PR with the above changes if that's helpful.

orengriffin commented 3 years ago

@libreninja looks like I beat you to it https://github.com/Starcounter-Jack/JSON-Patch/pull/264

I honestly wasn't aware of this thread when I opened the pr