From 60e7f39c90ed027cf5356a7a1a04cd91ff248284 Mon Sep 17 00:00:00 2001 From: BRO3886 <39856034+BRO3886@users.noreply.github.com> Date: Sun, 4 Jul 2021 13:29:17 +0530 Subject: [PATCH] :ambulance: fixes a list egde case --- Makefile | 10 ++++++---- cmd/tasks.go | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e72ed11..f1a8af2 100644 --- a/Makefile +++ b/Makefile @@ -8,15 +8,17 @@ linux: gtasks all: @echo "Building for every OS and Platform" - GOOS=windows GOARCH=386 go build -o ./bin/windows/gtasks.exe - GOOS=linux GOARCH=386 go build -o ./bin/linux/gtasks - GOOS=freebsd GOARCH=386 go build -o ./bin/freebsd/gtasks + GOOS=windows GOARCH=386 GO386=softfloat go build -o ./bin/windows/gtasks.exe + GOOS=linux GOARCH=386 GO386=softfloat go build -o ./bin/linux/gtasks + GOOS=freebsd GOARCH=386 GO386=softfloat go build -o ./bin/freebsd/gtasks GOOS=darwin GOARCH=amd64 go build -o ./bin/mac/gtasks + GOOS=darwin GOARCH=arm64 go build -o ./bin/m1/gtasks @echo "Zipping for release" @tar -czf bin/releases/gtasks_linux.tar.gz LICENSE -C bin/linux gtasks @tar -czf bin/releases/gtasks_win.tar.gz LICENSE -C bin/windows gtasks.exe @tar -czf bin/releases/gtasks_mac_amd64.tar.gz LICENSE -C bin/mac gtasks + @tar -czf bin/releases/gtasks_mac_m1_arm64.tar.gz LICENSE -C bin/m1 gtasks @tar -czf bin/releases/gtasks_bsd.tar.gz LICENSE -C bin/freebsd gtasks release: - gh release create $v 'bin/releases/gtasks_linux.tar.gz' 'bin/releases/gtasks_win.tar.gz' 'bin/releases/gtasks_bsd.tar.gz' 'bin/releases/gtasks_mac_amd64.tar.gz' \ No newline at end of file + gh release create $v 'bin/releases/gtasks_linux.tar.gz' 'bin/releases/gtasks_win.tar.gz' 'bin/releases/gtasks_bsd.tar.gz' 'bin/releases/gtasks_mac_amd64.tar.gz' 'bin/releases/gtasks_mac_m1_arm64.tar.gz' \ No newline at end of file diff --git a/cmd/tasks.go b/cmd/tasks.go index 9abdb48..f472270 100644 --- a/cmd/tasks.go +++ b/cmd/tasks.go @@ -222,7 +222,7 @@ func getTaskIndex(args []string, tasks []*tasks.Task, title string) int { argProvided = true index, err := strconv.Atoi(args[0]) - if err != nil || index >= len(tasks) || index < 1 { + if err != nil || index > len(tasks) || index < 1 { utils.ErrorP("%s", "Incorrect task number\n") }