From 47157b55f33fde3bf09c73d8bd2e60da14fd6e3b Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sat, 18 Nov 2017 00:06:37 +0900 Subject: [PATCH] replace header name --- tool/upgrade.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tool/upgrade.go b/tool/upgrade.go index f93f35c..94ed39d 100644 --- a/tool/upgrade.go +++ b/tool/upgrade.go @@ -4,6 +4,7 @@ package main import ( "archive/zip" + "bufio" "bytes" "fmt" "io" @@ -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()