diff options
-rw-r--r-- | tools/meson.build | 10 | ||||
-rw-r--r-- | tools/src/updater/main.go | 47 | ||||
-rw-r--r-- | tools/src/updater/manifest.go | 16 |
3 files changed, 0 insertions, 73 deletions
diff --git a/tools/meson.build b/tools/meson.build deleted file mode 100644 index 7008eca..0000000 --- a/tools/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -if get_option('updater').enabled() -custom_target('poi-update', - input: files('src/updater/main.go'), - output: 'poi-update', - command: ['env', 'GOPATH='+meson.current_source_dir(), go, 'build', go_args, '-o=@OUTPUT@', 'updater'], - build_by_default: true, - install: true, - install_dir: get_option('bindir'), -) -endif diff --git a/tools/src/updater/main.go b/tools/src/updater/main.go deleted file mode 100644 index e6e1560..0000000 --- a/tools/src/updater/main.go +++ /dev/null @@ -1,47 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "net/http" - "encoding/json" - "io/ioutil" -) - -func main() { - helpFlag := flag.Bool("help", false, "Show help information") - //verboseFlag := flag.Bool("verbose", false, "Print more information") - //repoFlag := flag.String("repo", "https://neueland.iserlohn-fortress.net/smolbote/downloads", "Repository path") - //dryRunFlag := flag.Bool("dry-run", false, "Dry run: only check files, do not download") - - flag.Parse() - - branchesRequest := "https://neueland.iserlohn-fortress.net/gitea/api/v1/repos/aqua/smolbote/branches" - - // help flag --> show usage and exit - if *helpFlag { - flag.PrintDefaults() - return - } - - response, err := http.Get(branchesRequest) - if err != nil { - panic(err) - } else if response.StatusCode != 200 { - fmt.Printf("Could not get manifest: %s\n", response.Status) - return - } - defer response.Body.Close() - - body, _ := ioutil.ReadAll(response.Body) - - var branches []BranchResponse - json.Unmarshal(body, &branches) - - - for _,v := range(branches) { - fmt.Printf("%s\t%s %s\n", v.Name, v.Commit.ID, v.Commit.Timestamp) - } - fmt.Println("done") - -} diff --git a/tools/src/updater/manifest.go b/tools/src/updater/manifest.go deleted file mode 100644 index f9d3d86..0000000 --- a/tools/src/updater/manifest.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -import ( - "time" -) - -type CommitResponse struct { - ID string `json:"id"` - Timestamp time.Time `json:"timestamp"` -} - -type BranchResponse struct { - Name string `json:"name"` - Commit CommitResponse `json:"commit"` -} - |