Created
June 29, 2020 12:25
-
-
Save earthgecko/03a6f42e10bad6edd6c571f46f7c90db to your computer and use it in GitHub Desktop.
Covert Pipfile.lock to requirements.txt in pure bash
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
cat Pipfile.lock \ | |
| grep -B1 '"hashes"\|"version": ' \ | |
| grep -v '"markers": \|"hashes": ' \ | |
| grep ": {\|version" \ | |
| sed -e 's/: {$//g' \ | |
| tr '\n' ',' | tr -s ' ' ' ' \ | |
| sed -e 's/, "version": "//g;s/", "/ /g;s/"//g;s/,//g' \ | |
| tr ' ' '\n' \ | |
| grep -v "^$" > requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment