satellitedb/dbx: remove sed usage for bash script

turns out portable sed is hard: it has to work with both
linux and bsd sed, etc. instead, use a really really basic
bash script and a temporary file. this should be much less
likely to cause issues on a wide range of machines.

Change-Id: Ia759789fb52aa1ee3361426bb6c02ed4eac3d23a
This commit is contained in:
Jeff Wendling 2020-01-07 10:52:54 -07:00
parent 6b21334c47
commit c740b82e66

View File

@ -17,7 +17,7 @@ import (
//go:generate dbx schema -d postgres -d cockroach satellitedb.dbx .
//go:generate dbx golang -d postgres -d cockroach -t templates satellitedb.dbx .
//go:generate bash -c "sed -i'' '1i //lint:file-ignore * generated file\n' satellitedb.dbx.go"
//go:generate bash -c "( echo '//lint:file-ignore * generated file'; cat satellitedb.dbx.go ) > satellitedb.dbx.go.tmp && mv satellitedb.dbx.go{.tmp,}"
//go:generate perl -p0i -e "s,^(\\s*\"github.com/lib/pq\")\\n\\n\\1,\\1,gm" satellitedb.dbx.go
var mon = monkit.Package()