summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-05-20 16:40:55 -0500
committerToby Vincent <tobyv13@gmail.com>2021-05-20 16:40:55 -0500
commitcbe88adb2c1478df823bcfc7dbb62730d6c8e040 (patch)
treef3b6ca36ce1a63b3b72d0feaeed9ecf2d928599d
parent6a721af96b493244d5852bfa698ac8a987f9237c (diff)
fix: fixed license to remove python dep
-rw-r--r--gitconfig2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitconfig b/gitconfig
index f2758f6..b7e93ea 100644
--- a/gitconfig
+++ b/gitconfig
@@ -61,7 +61,7 @@ smrm = "!f(){ git rm --cached \"$1\";rm -r \"$1\";git config -f .gitmodules --re
# generate git artifacts
ignore = "!f() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; f"
attributes = "!f() { curl -sL https://gist.githubusercontent.com/tobyvin/70f3671c76016063594ea45edbb97094/raw ;}; f"
-license = "!f() { curl -sH 'Accept: application/vnd.github.v3+json' https://api.github.com/licenses/$1 | (python2 -c \"import sys, json; print json.load(sys.stdin)['body'];\" | sed \"s/\\[year\\]/$(date +'%Y')/\" | sed \"s/\\[fullname\\]/$(git config --get user.name)/\"); }; f"
+license = "!f() { curl -sH 'Accept: application/vnd.github.v3+json' https://api.github.com/licenses/$1 | grep -oP '.*\"body\":\\s*\"\\K.*(?=\\s*\",)' | tr '\\n' '\\0' | xargs -0 printf '%b\\n' | sed \"s/\\[year\\]/$(date +'%Y')/\" | sed \"s/\\[fullname\\]/$(git config --get user.name)/\"; }; f"
# create and keep an empty directory at the provided path
keep = "!f() { ([ -f $@/.gitkeep ] || (mkdir -p $@ && curl -sL https://api.ef.gy/fortune > $@/.gitkeep)) && (grep -qsxF '!/**/.gitkeep' .gitignore || echo '!/**/.gitkeep' >> .gitignore) ;}; f"