Add makefile, add function for getting version
This commit is contained in:
parent
b7923c9091
commit
e3ac9e9b41
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
go.work
|
||||
museum-digital-webdav-uploader
|
||||
/go.work
|
||||
/bin
|
||||
|
30
main.go
30
main.go
@ -7,36 +7,12 @@ import (
|
||||
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/webui"
|
||||
)
|
||||
|
||||
// Attempts to connect to WebDAV server, verifying that the authentication data
|
||||
// works and that the server is one for uploads with museum-digital.
|
||||
// A museum-digital WebDAV directory can be identified by the availability of the
|
||||
// directories IMPORT_IMG and IMPORT_XML.
|
||||
// func verifyConnection(config MDWebDavUploaderConfig) bool {
|
||||
|
||||
// }
|
||||
|
||||
// Generates the contents of the file import_config.txt necessary
|
||||
// to let museum-digital know about the required import configuration.
|
||||
func generateImportConfigFile() { // string {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Uploads metadata files to the configured instance of
|
||||
// museum-digital / musdb.
|
||||
func uploadMetadataFiles() {
|
||||
|
||||
}
|
||||
|
||||
// Uploads media files to the configured instance of
|
||||
// museum-digital / musdb.
|
||||
func uploadMediaFiles() {
|
||||
|
||||
}
|
||||
|
||||
// Negotiates commands based on command line options.
|
||||
func main() {
|
||||
|
||||
if slices.Contains(os.Args, "--help") {
|
||||
} else if slices.Contains(os.Args, "--version") {
|
||||
cli.ShowVersion();
|
||||
} else if slices.Contains(os.Args, "--show-config") {
|
||||
cli.ShowCurrentConfig()
|
||||
} else if slices.Contains(os.Args, "--run-manual-setup") {
|
||||
|
22
makefile
Normal file
22
makefile
Normal file
@ -0,0 +1,22 @@
|
||||
VERSION := $(shell go run main.go --version)
|
||||
|
||||
hello:
|
||||
echo WebDAV uploader for museum-digital
|
||||
echo Version is $(VERSION)
|
||||
|
||||
build:
|
||||
go build -o bin/museum-digital-webdav-uploader main.go
|
||||
|
||||
run:
|
||||
go run main.go
|
||||
|
||||
compile:
|
||||
echo "Compiling for every OS and Platform"
|
||||
GOOS=linux GOARCH=amd64 go build -o bin/museum-digital-webdav-uploader-$(VERSION)-linux-amd64 main.go
|
||||
GOOS=windows GOARCH=amd64 go build -o bin/museum-digital-webdav-uploader-$(VERSION)-windows-amd64 main.go
|
||||
GOOS=darwin GOARCH=amd64 go build -o bin/museum-digital-webdav-uploader-$(VERSION)-macos-amd64 main.go
|
||||
GOOS=linux GOARCH=arm64 go build -o bin/museum-digital-webdav-uploader-$(VERSION)-linux-arm64 main.go
|
||||
GOOS=windows GOARCH=arm64 go build -o bin/museum-digital-webdav-uploader-$(VERSION)-windows-arm64 main.go
|
||||
GOOS=darwin GOARCH=arm64 go build -o bin/museum-digital-webdav-uploader-$(VERSION)-macos-arm64 main.go
|
||||
|
||||
all: hello build
|
@ -9,6 +9,7 @@ import (
|
||||
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/configloader"
|
||||
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/uploadsrcdir"
|
||||
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/webdavupload"
|
||||
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/meta"
|
||||
)
|
||||
|
||||
// Interal wrapper around opening a new bufio.Reader and getting an input
|
||||
@ -411,3 +412,8 @@ func HandleUpload() {
|
||||
fmt.Println("DONE")
|
||||
|
||||
}
|
||||
|
||||
// Prints current version.
|
||||
func ShowVersion() {
|
||||
fmt.Println(meta.GetVersion())
|
||||
}
|
||||
|
6
src/meta/meta.go
Normal file
6
src/meta/meta.go
Normal file
@ -0,0 +1,6 @@
|
||||
package meta
|
||||
|
||||
// Returns current version number.
|
||||
func GetVersion() string {
|
||||
return "0.1"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user