From b6358a184b7a217d1fc163ec492f42a188eee5de Mon Sep 17 00:00:00 2001 From: rodri Date: Thu, 11 Jun 2020 19:40:06 +0000 Subject: initial commit. --- gh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 gh (limited to 'gh') diff --git a/gh b/gh new file mode 100755 index 0000000..dede3ae --- /dev/null +++ b/gh @@ -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 -- cgit v1.2.3