From b1df581f63ee9f753d7dba035e143346f1d6044b Mon Sep 17 00:00:00 2001 From: nomadics9 Date: Tue, 7 Jan 2025 16:07:04 +0300 Subject: [PATCH] Api: repopath for alaskartv-app --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 56af857..5a8a397 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,9 @@ import ( func updateVersion(repoPath string, serviceName string) (string, error) { versionPath := fmt.Sprintf("%s/version.txt", repoPath) + if serviceName == "alaskartv" { + versionPath = fmt.Sprintf("%s/release.txt", repoPath) + } newVersion := getVersion(serviceName) godotenv.Load(".botenv") @@ -46,10 +49,8 @@ func updateVersion(repoPath string, serviceName string) (string, error) { } if serviceName == "alaskartv" { - versionPath = fmt.Sprintf("%s/release.txt", repoPath) bumpVersionTv(repoPath) } - os.WriteFile(versionPath, []byte(newVersion), 0644) cmds := [][]string{ {"git", "-C", repoPath, "add", "."}, @@ -83,7 +84,7 @@ func updateVersion(repoPath string, serviceName string) (string, error) { return "", fmt.Errorf("failed to marshal JSON: %w", err) } return string(jsonResponse), nil - } +} func bumpVersionTv(repoPath string) { filePath := fmt.Sprintf("%s/version.txt", repoPath)