calgo-lab / green-db

The monorepo that powers the GreenDB.
https://calgo-lab.github.io/green-db/
22 stars 2 forks source link

fix sed for windows #44

Closed en-GB closed 2 years ago

en-GB commented 2 years ago

no. i misread how -i works. this one should hopefully work everywhere.

en-GB commented 2 years ago

Apparently the problem is that macOS uses bsd sed by default while pretty much everyone else uses gnu sed. Since not all windows shells set $OS to windows_nt i changed it to assume GNU sed everywhere except on macOS. This is probably good enough but maybe it would be better to grep on sed --version

Alternatively we could set it to always make a new file and then delete it afterwards, which should be portable.