diff --git a/contribute/build-and-run.bat b/contribute/build-and-run.bat deleted file mode 100644 index f73189b..0000000 --- a/contribute/build-and-run.bat +++ /dev/null @@ -1,5 +0,0 @@ -@ECHO off - -cls -go build -ldflags "-X main.taigaUsername=my-username -X main.taigaPassword=my-password -X main.sandboxProjectSlug=my-sandbox-slug -X main.sandboxEpicID=1234567890 -X main.sandboxFileUploadPath=C:\tmp\bad-puns-make-me-sic.png" -o taigo-dev.exe || ECHO Failed to build the binary && exit 1 -.\taigo-dev.exe diff --git a/contribute/build-and-run.ps1 b/contribute/build-and-run.ps1 new file mode 100644 index 0000000..2f95606 --- /dev/null +++ b/contribute/build-and-run.ps1 @@ -0,0 +1,2 @@ +go build -o taigo-dev.exe -ldflags "-X main.taigaUsername=$env:taigaUsername -X main.taigaPassword=$env:taigaPassword -X main.sandboxProjectSlug=$env:sandboxProjectSlug -X main.sandboxEpicID=$env:sandboxEpicID -X main.sandboxFileUploadPath=$env:sandboxFileUploadPath" +.\taigo-dev.exe diff --git a/contribute/main.go b/contribute/main.go index 4623fb5..720c4d8 100644 --- a/contribute/main.go +++ b/contribute/main.go @@ -53,6 +53,14 @@ func init() { * fileAttachmentUploadPath = "C:\\Images\\Bad-puns-make-me-sic.1.jpg" // WINDOWS */ + for _, v := range []string{taigaUsername, taigaPassword, sandboxProjectSlug, sandboxEpicID, sandboxFileUploadPath} { + if v == "" { + log.Fatalln("All mandatory values must be set through an environment variable.", + "See README.md in the contribute folder for details!", + ) + } + } + // Convert Epic ID string to int var e error sandboxEpicID2, e = strconv.Atoi(sandboxEpicID) @@ -156,7 +164,7 @@ func main() { // Get milestones (for default project if set) // (total of 3; limited by the for-loop) log.Printf("Getting all Milestones(Sprints) for Project ID=%d, and printing the first 3 to the console:\n", project.ID) - milestones, mti, err := client.Project.Milestone.List(nil) + milestones, mti, err := client.Project.Milestone.List(&taiga.MilestonesQueryParams{Project: project.ID}) if err != nil { log.Println(err) return