diff --git a/Makefile b/Makefile index 8f5146e..eef671e 100644 --- a/Makefile +++ b/Makefile @@ -8,21 +8,21 @@ ensure-dist-dir: dist-win: ensure-dist-dir # Build for Windows x64 - GOOS=windows GOARCH=amd64 $(GOBUILD) -o dist/e6dl-windows-amd64.exe src/*.go + GOOS=windows GOARCH=amd64 $(GOBUILD) -o dist/e6dl-windows-amd64.exe main.go dist-macos: ensure-dist-dir # Build for macOS x64 - GOOS=darwin GOARCH=amd64 $(GOBUILD) -o dist/e6dl-darwin-amd64 src/*.go + GOOS=darwin GOARCH=amd64 $(GOBUILD) -o dist/e6dl-darwin-amd64 main.go dist-linux: ensure-dist-dir # Build for Linux x64 - GOOS=linux GOARCH=amd64 $(GOBUILD) -o dist/e6dl-linux-amd64 src/*.go + GOOS=linux GOARCH=amd64 $(GOBUILD) -o dist/e6dl-linux-amd64 main.go dist: dist-win dist-macos dist-linux build: @- mkdir -p bin - $(GOBUILD) -o bin/e6dl src/*.go + $(GOBUILD) -o bin/e6dl main.go @- chmod +x bin/e6dl install: build @@ -34,4 +34,4 @@ uninstall: rm $(INSTALLPATH)/e6dl run: - @- go run src/*.go \ No newline at end of file + @- go run main.go \ No newline at end of file diff --git a/src/download.go b/e621/download.go similarity index 99% rename from src/download.go rename to e621/download.go index 55f7796..69e18c0 100644 --- a/src/download.go +++ b/e621/download.go @@ -1,4 +1,4 @@ -package main +package e621 import ( "fmt" diff --git a/src/e621.go b/e621/e621.go similarity index 99% rename from src/e621.go rename to e621/e621.go index bac3209..df71fc1 100644 --- a/src/e621.go +++ b/e621/e621.go @@ -1,4 +1,4 @@ -package main +package e621 import ( "encoding/json" diff --git a/src/util.go b/e621/util.go similarity index 96% rename from src/util.go rename to e621/util.go index 67f7c8d..0ed0778 100644 --- a/src/util.go +++ b/e621/util.go @@ -1,4 +1,4 @@ -package main +package e621 import ( "net/http" diff --git a/src/main.go b/main.go similarity index 85% rename from src/main.go rename to main.go index 887c8a9..32d7cd9 100644 --- a/src/main.go +++ b/main.go @@ -5,6 +5,8 @@ import ( "fmt" "os" "path" + + "github.com/tjhorner/e6dl/e621" ) func main() { @@ -19,7 +21,7 @@ func main() { fmt.Printf("Fetching posts for \"%v\" (limit %v)\n", *tags, *postLimit) - posts, err := GetPostsForTags(*tags, *postLimit, *sfw) + posts, err := e621.GetPostsForTags(*tags, *postLimit, *sfw) if err != nil { fmt.Println(err) os.Exit(1) @@ -36,7 +38,7 @@ func main() { os.Exit(1) } - successes, failures, _ := BeginDownload(&posts, saveDirectory, maxConcurrents) + successes, failures, _ := e621.BeginDownload(&posts, saveDirectory, maxConcurrents) fmt.Printf("\nAll done! %d posts downloaded and saved. (%d failed to download)\n", *successes, *failures) }