Browse Source

switch swtich-*.sh back to sed now with -i.bak and rm lib.go.bak for compatibility with macos

pull/16/head
Dan Ballard 4 months ago
parent
commit
7d02f84174
  1. 9
      switch-ffi.sh
  2. 9
      switch-gomobile.sh

9
switch-ffi.sh

@ -1,5 +1,6 @@
#!/bin/sh
perl -pi -e "s/^package cwtch/\/\/package cwtch/" lib.go
perl -pi -e "s/^\/\/package main/package main/" lib.go
perl -pi -e "s/^\/\/func main\(\)/func main\(\)/" lib.go
# using '-i.bak' and 'rm .bak' for gnu sed (linux) and bsd sed (macosx) compat
sed -i.bak "s/^package cwtch/\/\/package cwtch/" lib.go
sed -i.bak "s/^\/\/package main/package main/" lib.go
sed -i.bak "s/^\/\/func main()/func main()/" lib.go
rm lib.go.bak

9
switch-gomobile.sh

@ -1,5 +1,6 @@
#!/bin/sh
perl -pi -e "s/^\/\/package cwtch/package cwtch/" lib.go
perl -pi -e "s/^package main/\/\/package main/" lib.go
perl -pi -e "s/^func main\(\)/\/\/func main\(\)/" lib.go
# using '-i.bak' and 'rm .bak' for gnu sed (linux) and bsd sed (macosx) compat
sed -i.bak "s/^\/\/package cwtch/package cwtch/" lib.go
sed -i.bak "s/^package main/\/\/package main/" lib.go
sed -i.bak "s/^func main()/\/\/func main()/" lib.go
rm lib.go.bak
Loading…
Cancel
Save