summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaksim Novikov2022-04-10 16:37:49 +0200
committerMaksim Novikov2022-04-10 16:37:49 +0200
commita3b8a6f9e4fc7ebb0f817429971929fb00ec4f5f (patch)
tree84222e12ee37fbabc59bf573fb98513f726eb47a
parent95c17088c0825b5a9a61c2fcede36133174aa0e0 (diff)
downloadaur-a3b8a6f9e4fc7ebb0f817429971929fb00ec4f5f.tar.gz
Rename binary to todoist-cli due to conflict with todoist-appimage. Update to 0.16.0
-rwxr-xr-x.SRCINFO14
-rw-r--r--.gitignore1
-rwxr-xr-xPKGBUILD25
-rw-r--r--rename_todoist_to_todoist_cli.patch141
4 files changed, 168 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4f578722b3b8..dd5f9f302a24 100755
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = todoist
pkgdesc = Todoist CLI Client, written in Golang.
- pkgver = 0.15.0
- pkgrel = 2
+ pkgver = 0.16.0
+ pkgrel = 1
url = https://github.com/sachaos/todoist
arch = x86_64
arch = i686
@@ -9,9 +9,15 @@ pkgbase = todoist
makedepends = go
makedepends = git
optdepends = peco: for zsh functions script
+ provides = todoist
+ provides = todoist-cli
+ conflicts = todoist
+ conflicts = todoist-cli
options = !strip
options = !emptydirs
- source = todoist-0.15.0.tar.gz::https://github.com/sachaos/todoist/archive/v0.15.0.tar.gz
- sha256sums = b7ffa14574bd241ab9e21a28f3d40c17b1a12250e89cfbc8ad708cfbfcdd84b3
+ source = todoist-0.16.0.tar.gz::https://github.com/sachaos/todoist/archive/v0.16.0.tar.gz
+ source = rename_todoist_to_todoist_cli.patch
+ sha256sums = 9d5a8f5c6b92d3d6df292f9ae96bec46049b4e4b7a482f7232e4e5b9708dfffa
+ sha256sums = 2d0f8626b98c6b178d6be15ad03be20a49c18add0cb3ec2a1f06e8e727785564
pkgname = todoist
diff --git a/.gitignore b/.gitignore
index 32f0ae164510..6368f532f64e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
src/
pkg/
+*.zst
*.tar.gz
*.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
index a312434ebc15..b4a63fdf22b7 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,9 +2,10 @@
# Contributor: David Roizenman <david@hmnd.io>
# Contributor: Austin Keller
+_pkgname=todoist-cli
pkgname=todoist
-pkgver=0.15.0
-pkgrel=2
+pkgver=0.16.0
+pkgrel=1
pkgdesc="Todoist CLI Client, written in Golang."
arch=('x86_64' 'i686')
url="https://github.com/sachaos/todoist"
@@ -12,12 +13,17 @@ license=('MIT')
makedepends=('go' 'git')
optdepends=('peco: for zsh functions script')
options=('!strip' '!emptydirs')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/sachaos/todoist/archive/v$pkgver.tar.gz")
-sha256sums=('b7ffa14574bd241ab9e21a28f3d40c17b1a12250e89cfbc8ad708cfbfcdd84b3')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/sachaos/todoist/archive/v$pkgver.tar.gz"
+ "rename_todoist_to_todoist_cli.patch")
+sha256sums=('9d5a8f5c6b92d3d6df292f9ae96bec46049b4e4b7a482f7232e4e5b9708dfffa'
+ '2d0f8626b98c6b178d6be15ad03be20a49c18add0cb3ec2a1f06e8e727785564')
+provides=('todoist' 'todoist-cli')
+conflicts=('todoist' 'todoist-cli')
prepare() {
mkdir -p "$srcdir/go/src/github.com/sachaos"
ln -sf "$srcdir/$pkgname-$pkgver" "$srcdir/go/src/github.com/sachaos/$pkgname"
+ patch --directory="$pkgname-$pkgver" --forward --strip=1 --input="${srcdir}/rename_todoist_to_todoist_cli.patch"
}
build() {
@@ -30,10 +36,11 @@ build() {
}
package() {
- install -Dm755 "$srcdir/go/bin/$pkgname" "$pkgdir/usr/bin/$pkgname"
+ install -Dm755 "$srcdir/go/bin/$pkgname" "$pkgdir/usr/bin/$_pkgname"
cd "$srcdir/go/src/github.com/sachaos/$pkgname"
- install -Dm644 todoist_functions.sh "${pkgdir}/usr/share/todoist/todoist_functions.sh"
- install -Dm644 todoist_functions_fzf.sh "${pkgdir}/usr/share/todoist/todoist_functions_fzf.sh"
- mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
- install -m 0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/"
+ install -Dm644 todoist_functions.sh "${pkgdir}/usr/share/$_pkgname/todoist_functions.sh"
+ install -Dm644 todoist_functions_fzf.sh "${pkgdir}/usr/share/$_pkgname/todoist_functions_fzf.sh"
+ install -Dm644 todoist_functions_fzf_bash.sh "${pkgdir}/usr/share/$_pkgname/todoist_functions_fzf_bash.sh"
+ mkdir -p "$pkgdir/usr/share/licenses/$_pkgname"
+ install -m 0644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/"
}
diff --git a/rename_todoist_to_todoist_cli.patch b/rename_todoist_to_todoist_cli.patch
new file mode 100644
index 000000000000..870756f4660a
--- /dev/null
+++ b/rename_todoist_to_todoist_cli.patch
@@ -0,0 +1,141 @@
+diff --git a/todoist_functions.sh b/todoist_functions.sh
+index ad4e7ce..b7b1e7a 100644
+--- a/todoist_functions.sh
++++ b/todoist_functions.sh
+@@ -1,4 +1,4 @@
+-select_items_command="todoist --namespace --project-namespace list | peco | cut -d ' ' -f 1 | tr '\n' ' '"
++select_items_command="todoist-cli --namespace --project-namespace list | peco | cut -d ' ' -f 1 | tr '\n' ' '"
+
+ function insert-in-buffer () {
+ if [ -n "$1" ]; then
+@@ -25,7 +25,7 @@ bindkey "^xtt" peco-todoist-item
+
+ # todoist find project
+ function peco-todoist-project () {
+- local SELECTED_PROJECT="$(todoist --project-namespace projects | peco | head -n1 | cut -d ' ' -f 1)"
++ local SELECTED_PROJECT="$(todoist-cli --project-namespace projects | peco | head -n1 | cut -d ' ' -f 1)"
+ insert-in-buffer "${SELECTED_PROJECT}" "-P"
+ }
+ zle -N peco-todoist-project
+@@ -33,7 +33,7 @@ bindkey "^xtp" peco-todoist-project
+
+ # todoist find labels
+ function peco-todoist-labels () {
+- local SELECTED_LABELS="$(todoist labels | peco | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
++ local SELECTED_LABELS="$(todoist-cli labels | peco | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
+ insert-in-buffer "${SELECTED_LABELS}" "-L"
+ }
+ zle -N peco-todoist-labels
+@@ -58,7 +58,7 @@ bindkey "^xtd" peco-todoist-date
+
+ function todoist-exec-with-select-task () {
+ if [ -n "$2" ]; then
+- BUFFER="todoist $1 $(echo "$2" | tr '\n' ' ')"
++ BUFFER="todoist-cli $1 $(echo "$2" | tr '\n' ' ')"
+ CURSOR=$#BUFFER
+ zle accept-line
+ fi
+diff --git a/todoist_functions_fzf.sh b/todoist_functions_fzf.sh
+index b234dd5..9b01e73 100644
+--- a/todoist_functions_fzf.sh
++++ b/todoist_functions_fzf.sh
+@@ -1,4 +1,4 @@
+-select_items_command="todoist --namespace --project-namespace list | fzf | cut -d ' ' -f 1 | tr '\n' ' '"
++select_items_command="todoist-cli --namespace --project-namespace list | fzf | cut -d ' ' -f 1 | tr '\n' ' '"
+
+ function insert-in-buffer () {
+ if [ -n "$1" ]; then
+@@ -25,7 +25,7 @@ bindkey "^xtt" fzf-todoist-item
+
+ # todoist find project
+ function fzf-todoist-project () {
+- local SELECTED_PROJECT="$(todoist --project-namespace projects | fzf | head -n1 | cut -d ' ' -f 1)"
++ local SELECTED_PROJECT="$(todoist-cli --project-namespace projects | fzf | head -n1 | cut -d ' ' -f 1)"
+ insert-in-buffer "${SELECTED_PROJECT}" "-P"
+ }
+ zle -N fzf-todoist-project
+@@ -33,7 +33,7 @@ bindkey "^xtp" fzf-todoist-project
+
+ # todoist find labels
+ function fzf-todoist-labels () {
+- local SELECTED_LABELS="$(todoist labels | fzf | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
++ local SELECTED_LABELS="$(todoist-cli labels | fzf | cut -d ' ' -f 1 | tr '\n' ',' | sed -e 's/,$//')"
+ insert-in-buffer "${SELECTED_LABELS}" "-L"
+ }
+ zle -N fzf-todoist-labels
+@@ -58,7 +58,7 @@ bindkey "^xtd" fzf-todoist-date
+
+ function todoist-exec-with-select-task () {
+ if [ -n "$2" ]; then
+- BUFFER="todoist $1 $(echo "$2" | tr '\n' ' ')"
++ BUFFER="todoist-cli $1 $(echo "$2" | tr '\n' ' ')"
+ CURSOR=$#BUFFER
+ zle accept-line
+ fi
+diff --git a/todoist_functions_fzf_bash.sh b/todoist_functions_fzf_bash.sh
+index b804b4f..792b20c 100644
+--- a/todoist_functions_fzf_bash.sh
++++ b/todoist_functions_fzf_bash.sh
+@@ -27,14 +27,14 @@ _todoist() {
+
+ for arg in "${COMP_WORDS[@]}"; do
+ case "$arg" in
+- todoist)
+- cmd='todoist'
++ todoist-cli)
++ cmd='todoist-cli'
+ ;;
+ # These are the current commands; not all have completion options,
+ # but they're listed here anyway, for the future
+ list|show|completed-list|add|modify|close|delete|labels|projects|\
+ karma|sync|quick|help)
+- [ "$cmd" == 'todoist' ] && cmd+="__$arg"
++ [ "$cmd" == 'todoist-cli' ] && cmd+="__$arg"
+ ;;
+ l)
+ cmd+='__list'
+@@ -74,7 +74,7 @@ _todoist() {
+ ' --project-namespace --help -h --version -v '
+
+ case "$cmd" in
+- todoist)
++ todoist-cli)
+ opts+='list l show completed-list c-l cl add a modify m close c'\
+ ' delete d labels projects karma sync s quick q help h'
+ ;;
+@@ -98,17 +98,17 @@ _todoist() {
+ ;;
+ --label-ids|-L)
+ # shellcheck disable=SC2207
+- COMPREPLY=( $(todoist labels | $fzfcmd --multi | cut -d ' ' -f 1 \
++ COMPREPLY=( $(todoist-cli labels | $fzfcmd --multi | cut -d ' ' -f 1 \
+ | paste -d, -s -) )
+ return 0
+ ;;
+ --project-id|-P)
+ # shellcheck disable=SC2207
+- COMPREPLY=( $(todoist projects | $fzfcmd | cut -d ' ' -f 1) )
++ COMPREPLY=( $(todoist-cli projects | $fzfcmd | cut -d ' ' -f 1) )
+ return 0
+ ;;
+ --project-name|-N)
+- COMPREPLY=( "'$(todoist projects | $fzfcmd | cut -d ' ' -f 2- \
++ COMPREPLY=( "'$(todoist-cli projects | $fzfcmd | cut -d ' ' -f 2- \
+ | cut -b 2- )'" )
+ return 0
+ ;;
+@@ -144,7 +144,7 @@ _todoist() {
+ __todoist_debug "fzfcmd=$fzfcmd"
+
+ # shellcheck disable=SC2207
+- COMPREPLY=( $(todoist --namespace --project-namespace list \
++ COMPREPLY=( $(todoist-cli --namespace --project-namespace list \
+ | $fzfcmd | cut -d ' ' -f 1 | tr -d "'") )
+ return 0
+ fi
+@@ -155,4 +155,4 @@ _todoist() {
+ [ -n "$opts" ] && COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
+ }
+
+-complete -F _todoist todoist
++complete -F _todoist todoist-cli