PowerShell/demos/rest/curlDemo.txt

20 lines
611 B
Text
Raw Normal View History

2016-07-26 00:29:42 +02:00
# EQ Linux
# get the json from the repo api and assign it to the txt file
# This grads the json file from the API
2016-07-26 00:42:30 +02:00
curl -u <insert GitHub PAT token> <insert GitHub repo URL> > outputtest.txt
2016-07-26 00:29:42 +02:00
# Reformats the json block to proper json (removes the newlines)
string=$(cat temp.txt)
# Replace the "private" value to false
find='"private": true'
replace='"private": false'
string2=${string/$find/$replace}
# push the json block into a txt file
echo $string2 > output.txt
# Post the updated JSON data to the repo
2016-07-26 00:42:30 +02:00
curl -u <insert GitHub PAT token> <insert GitHub repo URL> --data @output.txt