mattermost-server
mmfileget
vendor
+vendor-done
+++ /dev/null
-GO ?= go
-
-all: mmfileget
-
-mmfileget: main.go mattermost-server vendor
- $(GO) build -mod=vendor
-
-mattermost-server:
- git clone --depth 1 --branch v5.11.1 https://github.com/mattermost/mattermost-server.git
-
-vendor: mattermost-server
- ln -s mattermost-server/vendor
- ln -s $(PWD)/mattermost-server vendor/github.com/mattermost/mattermost-server
--- /dev/null
+redo-ifchange mmfileget
go 1.13
-require github.com/mattermost/mattermost-server v5.11.1+incompatible
+require github.com/mattermost/mattermost-server v5.29.0+incompatible
-replace github.com/mattermost/mattermost-server v5.11.1+incompatible => ./mattermost-server
+replace github.com/mattermost/mattermost-server v5.29.0+incompatible => ./mattermost-server
"path/filepath"
"strings"
- "github.com/mattermost/mattermost-server/model"
+ "github.com/mattermost/mattermost-server/v5/model"
)
func main() {
- url := os.Args[1] // https://MACHINE/api/v4/files/FILE
+ url := strings.TrimPrefix(os.Args[1], "-") // -?https://MACHINE/api/v4/files/FILE
s := strings.Split(url, "/")
machine, fileId := s[2], s[6]
--- /dev/null
+redo-ifchange main.go vendor-done
+${GO:-go} build -o $3 -mod=vendor
--- /dev/null
+git clone --depth 1 --branch v5.29.0 https://github.com/mattermost/mattermost-server.git
+ln -fs mattermost-server/vendor .
+rm vendor/modules.txt
+mkdir -p vendor/github.com/mattermost/mattermost-server
+ln -fs `pwd`/mattermost-server vendor/github.com/mattermost/mattermost-server/v5
+touch $3