mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
taskie: Updated backends to use common code.
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
70dbc4dc1d
commit
cfad8b1576
6 changed files with 174 additions and 98 deletions
|
|
@ -1,3 +1,8 @@
|
|||
nux.use taskie/githublike
|
||||
|
||||
githublike github
|
||||
|
||||
|
||||
backend.github.with() {
|
||||
github_repository=$(echo $backendId | cut -d: -f2)
|
||||
github_api_url=https://api.github.com
|
||||
|
|
@ -6,12 +11,22 @@ backend.github.with() {
|
|||
github_issuemap=~/.config/taskie/github.issuemap.json
|
||||
nux.log debug Github repository is $github_repository;
|
||||
nux.log debug Github API URL: $github_api_url;
|
||||
|
||||
githublike_wrapper=github
|
||||
githublike_api=$github_api_url;
|
||||
githublike_repository=$github_repository;
|
||||
githublike_api_append="";
|
||||
githublike_curl_params="-u $github_api_user:$github_api_token";
|
||||
githublike_next_append="";
|
||||
githublike.with
|
||||
}
|
||||
|
||||
backend.github.list() {
|
||||
local api="$github_api_url/repos/$github_repository/issues"
|
||||
|
||||
CURL_ADDITIONAL_ARGS="-u $github_api_user:$github_api_token" \
|
||||
backend.githublike.get "$api" | jq -r ".[] | [.number,.state,.title] | @sh"
|
||||
backend.github.detect() {
|
||||
closest_git=$(nuxfs.closest .git "$1")
|
||||
|
||||
git.origins "$closest_git" | grep github.com | while read origin
|
||||
do
|
||||
repo=$(nux.url.parse "$origin" "\9")
|
||||
echo $repo:$closest_git
|
||||
done
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue