-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Go parameters | ||
GOCMD=go | ||
GOBUILD=$(GOCMD) build | ||
GOCLEAN=$(GOCMD) clean | ||
GOTEST=$(GOCMD) test | ||
GOGET=$(GOCMD) get | ||
BIN=bin | ||
BINARY_NAME=$(BIN)/moodle-fetcher | ||
BINARY_UNIX=$(BINARY_NAME)_unix | ||
BINARY_WINDOWS=$(BINARY_NAME)_windows | ||
BINARY_DARWIN=$(BINARY_NAME)_darwin | ||
PACKAGE=$(BINARY_NAME).tar.gz | ||
|
||
|
||
all: test build | ||
build: | ||
$(GOBUILD) -o $(BINARY_NAME) -v | ||
clean: | ||
$(GOCLEAN) | ||
rm -rf $(BIN) | ||
run: | ||
$(GOBUILD) -o $(BINARY_NAME) -v ./... | ||
./$(BINARY_NAME) | ||
|
||
# Cross compilation | ||
build-linux: | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v | ||
build-windows: | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BINARY_WINDOWS) -v | ||
build-darwin: | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_DARWIN) -v | ||
package: | ||
tar -czf $(PACKAGE) * | ||
|
||
release: build-linux build-windows build-darwin package | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
A small command line tool to download ressources, like pdfs or images, from moodle. | ||
A small command line tool for downloading resources, like pdfs or images, from Moodle. | ||
|
||
Install: | ||
Build: | ||
``` | ||
$ go get github.com/s-gheldd/moodle-fetcher | ||
$ go get github.com/s-gheldd/moodle-fetcher | ||
``` | ||
(or clone and go install) | ||
``` | ||
$ git clone github.com/s-gheldd/moodle-fetcher.git | ||
$ go install | ||
``` | ||
(or clone and make) | ||
``` | ||
$ git clone github.com/s-gheldd/moodle-fetcher.git | ||
$ make | ||
``` | ||
Install: | ||
Download release for your OS. | ||
|
||
Usage: | ||
``` | ||
$ moodle-fetcher -u <url> [-p <password>] -n <username> | ||
``` | ||
``` |