From 504e2bd976486394c27ea70056c15c1238e4d179 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 17 Oct 2024 20:40:34 +0300 Subject: [PATCH] main: move into cmd directory --- .gitignore | 2 +- build.sh | 2 +- config.go => cmd/gomuks/config.go | 0 gomuks.go => cmd/gomuks/gomuks.go | 0 main.go => cmd/gomuks/main.go | 0 media.go => cmd/gomuks/media.go | 16 ++++++++++++++++ server.go => cmd/gomuks/server.go | 0 websocket.go => cmd/gomuks/websocket.go | 0 8 files changed, 18 insertions(+), 2 deletions(-) rename config.go => cmd/gomuks/config.go (100%) rename gomuks.go => cmd/gomuks/gomuks.go (100%) rename main.go => cmd/gomuks/main.go (100%) rename media.go => cmd/gomuks/media.go (90%) rename server.go => cmd/gomuks/server.go (100%) rename websocket.go => cmd/gomuks/websocket.go (100%) diff --git a/.gitignore b/.gitignore index 123bc5c..69d28f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .idea/ target/ .tmp/ -gomuks +/gomuks start run *.exe diff --git a/build.sh b/build.sh index 21f3540..24f1666 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/bash go generate ./web export MAUTRIX_VERSION=$(cat go.mod | grep 'maunium.net/go/mautrix ' | head -n1 | awk '{ print $2 }') -go build -ldflags "-X main.Tag=$(git describe --exact-match --tags 2>/dev/null) -X main.Commit=$(git rev-parse HEAD) -X 'main.BuildTime=`date -Iseconds`' -X 'maunium.net/go/mautrix.GoModVersion=$MAUTRIX_VERSION'" "$@" || exit 2 +go build -ldflags "-X main.Tag=$(git describe --exact-match --tags 2>/dev/null) -X main.Commit=$(git rev-parse HEAD) -X 'main.BuildTime=`date -Iseconds`' -X 'maunium.net/go/mautrix.GoModVersion=$MAUTRIX_VERSION'" ./cmd/gomuks "$@" || exit 2 diff --git a/config.go b/cmd/gomuks/config.go similarity index 100% rename from config.go rename to cmd/gomuks/config.go diff --git a/gomuks.go b/cmd/gomuks/gomuks.go similarity index 100% rename from gomuks.go rename to cmd/gomuks/gomuks.go diff --git a/main.go b/cmd/gomuks/main.go similarity index 100% rename from main.go rename to cmd/gomuks/main.go diff --git a/media.go b/cmd/gomuks/media.go similarity index 90% rename from media.go rename to cmd/gomuks/media.go index f36989b..760a308 100644 --- a/media.go +++ b/cmd/gomuks/media.go @@ -1,3 +1,19 @@ +// gomuks - A Matrix client written in Go. +// Copyright (C) 2024 Tulir Asokan +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + package main import ( diff --git a/server.go b/cmd/gomuks/server.go similarity index 100% rename from server.go rename to cmd/gomuks/server.go diff --git a/websocket.go b/cmd/gomuks/websocket.go similarity index 100% rename from websocket.go rename to cmd/gomuks/websocket.go