From 1669f10a60062e6964458859b7292b62369d34e3 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Tue, 13 Aug 2024 08:55:22 +0200 Subject: [PATCH] Initial commit --- .air.toml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ go.mod | 5 +++++ go.sum | 2 ++ main.go | 33 +++++++++++++++++++++++++++++++++ types.go | 9 +++++++++ 6 files changed, 102 insertions(+) create mode 100644 .air.toml create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 go.sum create mode 100644 main.go create mode 100644 types.go diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..7ed345f --- /dev/null +++ b/.air.toml @@ -0,0 +1,51 @@ +root = "." +testdata_dir = "testdata" +tmp_dir = "tmp" + +[build] + args_bin = [] + bin = "tmp\\main.exe" + cmd = "go run ." + delay = 1000 + exclude_dir = ["assets", "tmp", "vendor", "testdata"] + exclude_file = [] + exclude_regex = ["_test.go"] + exclude_unchanged = false + follow_symlink = false + full_bin = "" + include_dir = [] + include_ext = ["go", "tpl", "tmpl", "html"] + include_file = [] + kill_delay = "0s" + log = "build-errors.log" + poll = false + poll_interval = 0 + post_cmd = [] + pre_cmd = [] + rerun = false + rerun_delay = 500 + send_interrupt = false + stop_on_error = false + +[color] + app = "" + build = "yellow" + main = "magenta" + runner = "green" + watcher = "cyan" + +[log] + main_only = false + time = false + +[misc] + clean_on_exit = false + +[proxy] + app_port = 0 + enabled = false + proxy_port = 0 + +[screen] + clear_on_rebuild = false + keep_scroll = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6c21b9a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +tmp +main.log diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..65fa51a --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module main + +go 1.22.4 + +require github.com/mattn/go-sqlite3 v1.14.22 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e8d092a --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= diff --git a/main.go b/main.go new file mode 100644 index 0000000..4d89651 --- /dev/null +++ b/main.go @@ -0,0 +1,33 @@ +package main + +import ( + "fmt" + "io" + "log" + "os" + "database/sql" + _ "github.com/mattn/go-sqlite3" +) + +var Error *log.Logger + +func init() { + log.SetFlags(log.Lmicroseconds | log.Lshortfile) + logFile, err := os.Create("main.log") + if err != nil { + log.Printf("Error creating log file: %v", err) + os.Exit(1) + } + logger := io.MultiWriter(os.Stdout, logFile) + log.SetOutput(logger) + + Error = log.New(io.MultiWriter(logFile, os.Stderr, os.Stdout), + fmt.Sprintf("%sERROR:%s ", "\033[0;101m", "\033[0m"), + log.Lmicroseconds|log.Lshortfile) +} + +const projectsFile = `C:\Users\Administrator\Seafile\VSCode\Code\User\globalStorage\state.vscdb` + +func main() { + +} diff --git a/types.go b/types.go new file mode 100644 index 0000000..879d35e --- /dev/null +++ b/types.go @@ -0,0 +1,9 @@ +package main + +type Project struct { + Name string `json:"name"` + RootPath string `json:"rootPath"` + Paths []string `json:"paths"` + Tags []string `json:"tags"` + Enabled bool `json:"enabled"` +}