aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorlawl <github@dumbinter.net>2020-12-13 06:28:00 +0100
committerlawl <github@dumbinter.net>2020-12-13 06:28:00 +0100
commitd8be27d86e8c8068f08b7e7cef8a2f255b1714fd (patch)
treeb071985bd96c0dd4719a339e37813ab58e683b0e /scripts
parent595b8ab9b4feaa3f4eb1bb5064737c7b2ce13473 (diff)
downloadnoisetorch-d8be27d86e8c8068f08b7e7cef8a2f255b1714fd.tar.gz
noisetorch-d8be27d86e8c8068f08b7e7cef8a2f255b1714fd.zip
Make patreon call to action look nicer
Diffstat (limited to 'scripts')
-rw-r--r--scripts/embedbinary.go (renamed from scripts/embedlibrnnoise.go)11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/embedlibrnnoise.go b/scripts/embedbinary.go
index 43daf80..1f11ce4 100644
--- a/scripts/embedlibrnnoise.go
+++ b/scripts/embedbinary.go
@@ -1,6 +1,7 @@
package main
import (
+ "flag"
"fmt"
"io/ioutil"
"os"
@@ -8,15 +9,17 @@ import (
)
func main() {
- b, err := ioutil.ReadFile("librnnoise_ladspa/bin/ladspa/librnnoise_ladspa.so")
+ flag.Parse()
+ args := flag.Args()
+ b, err := ioutil.ReadFile(args[0])
if err != nil {
- fmt.Printf("Couldn't read librnnoise_ladspa.so: %v\n", err)
+ fmt.Printf("Couldn't read '%s': %v\n", args[0], err)
os.Exit(1)
}
- out, _ := os.Create("librnnoise.go")
+ out, _ := os.Create(args[1])
defer out.Close()
- out.Write([]byte("package main \n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar libRNNoise = []byte{\n"))
+ out.Write([]byte("package main \n\n//THIS FILE IS AUTOMATICALLY GENERATED BY `go generate` DO NOT EDIT!\n\nvar " + args[2] + " = []byte{\n"))
for i, c := range b {
out.Write([]byte(strconv.Itoa(int(c))))
out.Write([]byte(","))