Created
February 15, 2021 17:09
-
-
Save mfansler/492f2d35623002452bb9bc8cb1db11bd to your computer and use it in GitHub Desktop.
Download Conda package tarballs needed to create an environment
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
#!/bin/bash -l | |
# use tmp dir to avoid name conflicts | |
tmp=$(mktemp -d) | |
# solve environment, ignoring existing cache | |
CONDA_PKGS_DIRS=$tmp conda create -dp $tmp/0 --json "$@" |\ | |
# filter to tarball URLs | |
grep '"url"' | grep -oE 'https[^"]+' |\ | |
# download locally | |
xargs wget -c | |
# clean up | |
rm -r $tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment