Skip to content

Instantly share code, notes, and snippets.

@galaxy001
Forked from muzi502/raw_github.sh
Created April 3, 2020 07:16
Show Gist options
  • Save galaxy001/e9c747f30549fff019f0d8d0f466ccd7 to your computer and use it in GitHub Desktop.
Save galaxy001/e9c747f30549fff019f0d8d0f466ccd7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# data: 2020-03-31
# author: muzi502
# for: Fuck GFW and download some raw file form github without proxy using jsDelivr CDN
# usage: save the .she to your local such as /usr/bin/rawg, and chmod +x /usr/bin/rawg
# use rawg https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh to download
set -xue
# GitHub rul: https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh
# jsDelivr url: https://cdn.jsdelivr.net/gh/ohmyzsh/ohmyzsh/tools/install.sh
wget $(echo $1 | sed 's/raw.githubusercontent.com/cdn.jsdelivr.net\/gh/' \
| sed 's/github.com/cdn.jsdelivr.net\/gh/' \
| sed 's/\/master//' | sed 's/\/blob//' )
# curl $(echo $1 | sed 's/raw.githubusercontent.com/cdn.jsdelivr.net\/gh/' \
# | sed 's/github.com/cdn.jsdelivr.net\/gh/' \
# | sed 's/\/master//' | sed 's/\/blob//' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment