Skip to content

Commit

Permalink
change project name
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Sep 3, 2022
1 parent 1661b61 commit 71e0dc7
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 61 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gorinth
# mrpack-install

[![Go Reference](https://pkg.go.dev/badge/github.com/nothub/gorinth.svg)](https://pkg.go.dev/github.com/nothub/gorinth)
[![Go Reference](https://pkg.go.dev/badge/github.com/nothub/mrpack-install.svg)](https://pkg.go.dev/github.com/nothub/mrpack-install)

A cli application for installing Minecraft servers
and [Modrinth](https://modrinth.com/) [modpacks](https://docs.modrinth.com/docs/modpacks/format_definition/).
45 changes: 0 additions & 45 deletions cmd/install.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

modrinth "github.com/nothub/gorinth/modrinth/api"
modrinth "github.com/nothub/mrpack-install/modrinth/api"
"github.com/spf13/cobra"
)

Expand Down
31 changes: 30 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package cmd

import (
"github.com/nothub/mrpack-install/http"
"log"
"net/url"
"os"

"github.com/spf13/cobra"
Expand All @@ -13,9 +16,35 @@ func init() {
}

var rootCmd = &cobra.Command{
Use: "gorinth",
Use: "mrpack-install",
Short: "Modrinth Modpack server deployment",
Long: `A cli application for installing Minecraft servers and Modrinth modpacks.`,

Run: func(cmd *cobra.Command, args []string) {
if len(args) < 1 {
// TODO: cobra arg checks
log.Fatalln("argghh")
}

if _, err := os.Stat(args[0]); err == nil {
// arg is existing file path

} else if _, err := url.Parse(args[0]); err != nil {
// arg is valid url

file, err := http.Instance.DownloadFile(args[0], ".")
if err != nil {
log.Fatalln(err)
}
log.Println("Stored mrpack to:", file)

} else {
// arg is project id?
// TODO
}

// TODO
},
}

func Execute() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cmd

import (
"fmt"
"github.com/nothub/gorinth/http"
"github.com/nothub/gorinth/mojang"
"github.com/nothub/gorinth/server"
"github.com/nothub/mrpack-install/http"
"github.com/nothub/mrpack-install/mojang"
"github.com/nothub/mrpack-install/server"
"github.com/spf13/cobra"
"log"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/nothub/gorinth
module github.com/nothub/mrpack-install

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var Instance *Client = nil

func init() {
Instance = &Client{
UserAgent: "gorinth",
UserAgent: "mrpack-install",
HTTPClient: &http.Client{},
}
info, ok := debug.ReadBuildInfo()
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/nothub/gorinth/cmd"
"github.com/nothub/mrpack-install/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion modrinth/api/client.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api

import (
"github.com/nothub/gorinth/http"
"github.com/nothub/mrpack-install/http"
"log"
"net/url"
)
Expand Down
2 changes: 1 addition & 1 deletion modrinth/mrpack/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"io"
)

import modrinth "github.com/nothub/gorinth/modrinth/api"
import modrinth "github.com/nothub/mrpack-install/modrinth/api"

type Index struct {
FormatVersion int `json:"formatVersion"`
Expand Down
2 changes: 1 addition & 1 deletion modrinth/mrpack/mrpack_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mrpack

import (
"github.com/nothub/gorinth/http"
"github.com/nothub/mrpack-install/http"
"log"
"os"
"testing"
Expand Down
2 changes: 1 addition & 1 deletion mojang/api.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mojang

import (
"github.com/nothub/gorinth/http"
"github.com/nothub/mrpack-install/http"
)

const manifestUrl = "https://launchermeta.mojang.com/mc/game/version_manifest.json"
Expand Down
2 changes: 1 addition & 1 deletion server/fabric.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package server

import (
"errors"
"github.com/nothub/gorinth/http"
"github.com/nothub/mrpack-install/http"
"net/url"
)

Expand Down
2 changes: 1 addition & 1 deletion server/paper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package server

import (
"errors"
"github.com/nothub/gorinth/http"
"github.com/nothub/mrpack-install/http"
"strconv"
)

Expand Down

0 comments on commit 71e0dc7

Please sign in to comment.