diff options
Diffstat (limited to 'tool/upgrade.go')
-rw-r--r-- | tool/upgrade.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tool/upgrade.go b/tool/upgrade.go index f93f35c..275f915 100644 --- a/tool/upgrade.go +++ b/tool/upgrade.go @@ -4,6 +4,7 @@ package main import ( "archive/zip" + "bufio" "bytes" "fmt" "io" @@ -28,7 +29,7 @@ func main() { var url string doc.Find("a").Each(func(_ int, s *goquery.Selection) { if url == "" && strings.HasPrefix(s.Text(), "sqlite-amalgamation-") { - url = "https://www.sqlite.org/2017/" + s.Text() + url = "https://www.sqlite.org/2018/" + s.Text() } }) if url == "" { @@ -80,7 +81,18 @@ func main() { f.Close() log.Fatal(err) } - _, err = io.Copy(f, zr) + scanner := bufio.NewScanner(zr) + for scanner.Scan() { + text := scanner.Text() + if text == `#include "sqlite3.h"` { + text = `#include "sqlite3-binding.h"` + } + _, err = fmt.Fprintln(f, text) + if err != nil { + break + } + } + err = scanner.Err() if err != nil { zr.Close() f.Close() |