diff options
author | rodri <rgl@antares-labs.eu> | 2020-06-11 19:40:06 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2020-06-11 19:40:06 +0000 |
commit | b6358a184b7a217d1fc163ec492f42a188eee5de (patch) | |
tree | 246a8ae4d3be4cd2e51b6df44a5c5c0e3357895f /gh | |
download | github9-b6358a184b7a217d1fc163ec492f42a188eee5de.tar.gz github9-b6358a184b7a217d1fc163ec492f42a188eee5de.tar.bz2 github9-b6358a184b7a217d1fc163ec492f42a188eee5de.zip |
initial commit.
Diffstat (limited to 'gh')
-rwxr-xr-x | gh | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,26 @@ +#!/bin/rc +rfork ne +token=YOUR_TOKEN_HERE +method=() +url=() +data=() + +fn usage { + echo usage: gh method url >[1=2] + exit usage +} + +if(! ~ $#* 2) + usage + +method=$1 +url=$2 +if(~ $method POST PUT){ +# echo enter the data: +# data=`{{echo holdon >[1=3]; cat /dev/cons}>[3]/dev/consctl} + data=`{read -m} +} + +hget -m $method -r 'Authorization: token '^$token\ + -p $"data\ + https://api.github.com^$url |