Created
July 21, 2021 17:59
-
-
Save DavidWells/1e097ad71c750354d075d8d95a34d27e to your computer and use it in GitHub Desktop.
Download repo via package.json scripts. Remove $GH_DOWNLOAD_TOKEN if public repo. `npm run download`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"predownload": "rimraf ./tmp-folder && rimraf ./folder && mkdirp ./folder", | |
"download": "curl -H \"Authorization: token $GH_DOWNLOAD_TOKEN\" -L https://api.github.com/repos/repo/repoName/zipball/master > repo.zip", | |
"postdownload": "unzip -q -d ./tmp-folder repo.zip && cd tmp-folder && mv `ls` repo && mv `ls` ../folder && echo 'repo downloaded!'", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment