Skip to content

Commit

Permalink
🚑 fixes a list egde case
Browse files Browse the repository at this point in the history
  • Loading branch information
BRO3886 committed Jul 4, 2021
1 parent 720e50a commit 60e7f39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
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'
2 changes: 1 addition & 1 deletion cmd/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 60e7f39

Please sign in to comment.