Skip to content

Commit acbc45e

Browse files
committed
Fix compute today, date without -u
1 parent 4fee58a commit acbc45e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gh-todo

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ EOF
1919
}
2020

2121
version="0.1.0"
22-
date=$(date -u +"%Y-%m-%d")
22+
today=$(date +"%Y-%m-%d")
2323
repo="$(gh config get -h github.com user)/todo"
2424

2525
get_issue_id() {
26-
echo $(gh issue list --search "$date" --json "number" --jq ".[0].number" --repo $repo)
26+
gh issue list --search "$today" --json "number" --jq ".[0].number" --repo $repo
2727
}
2828

2929
init() {
@@ -34,9 +34,9 @@ add() {
3434
input="$1"
3535
issue_id=$(get_issue_id)
3636
if [[ -z $issue_id ]]; then
37-
exec gh issue create --title $date --body "- [ ] $input" --repo $repo
37+
exec gh issue create --title $today --body "- [ ] $input" --repo $repo
3838
else
39-
body=$(gh issue list --search "$date" --json "body" --jq ".[0].body" --repo $repo)
39+
body=$(gh issue list --search "$today" --json "body" --jq ".[0].body" --repo $repo)
4040
body=$(echo -e "$body\n- [ ] $input")
4141
exec gh issue edit $issue_id --body "$body" --repo $repo
4242
fi

0 commit comments

Comments
 (0)