fix upgrade script

This commit is contained in:
Yasuhiro Matsumoto
2026-01-01 22:44:09 +09:00
parent aa7cdd300f
commit 2f6a2bbbfd

View File

@@ -116,10 +116,7 @@ func main() {
if !ok { if !ok {
log.Fatal("could not get current file info") log.Fatal("could not get current file info")
} }
err := os.Chdir(filepath.Dir(filepath.Dir(file))) basedir := filepath.Dir(filepath.Dir(file))
if err != nil {
log.Fatalf("could not change directory: %s", err)
}
// Download Amalgamation // Download Amalgamation
_, amalgamation, err := download("sqlite-amalgamation-") _, amalgamation, err := download("sqlite-amalgamation-")
@@ -150,11 +147,11 @@ func main() {
var f *os.File var f *os.File
switch path.Base(zf.Name) { switch path.Base(zf.Name) {
case "sqlite3.c": case "sqlite3.c":
f, err = os.Create("../sqlite3-binding.c") f, err = os.Create(filepath.Join(basedir, "sqlite3-binding.c"))
case "sqlite3.h": case "sqlite3.h":
f, err = os.Create("../sqlite3-binding.h") f, err = os.Create(filepath.Join(basedir, "sqlite3-binding.h"))
case "sqlite3ext.h": case "sqlite3ext.h":
f, err = os.Create("../sqlite3ext.h") f, err = os.Create(filepath.Join(basedir, "sqlite3ext.h"))
default: default:
continue continue
} }