-
-
Save tacaswell/e216cc8094307f200636efedfec8eebe to your computer and use it in GitHub Desktop.
replace conda with condalog to get pass through behavior
This file contains hidden or 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 | |
LOGBOOK=bs-testing | |
pkg_list_base="/tmp/automated-list-of-conda-packages" | |
echo "pkg_list_base=$pkg_list_base" | |
#exit 1 | |
echo " | |
Capturing current list of conda packages in | |
[$CONDA_DEFAULT_ENV] | |
(if empty, you are in the root environment | |
" | |
conda list -e > $pkg_list_base-before.txt | |
conda $* | |
#source activate /tmp/foo | |
echo " | |
Capturing current list of conda packages in | |
[$CONDA_DEFAULT_ENV] | |
(if empty, you are in the root environment | |
" | |
conda list -e > $pkg_list_base-after.txt | |
diff $pkg_list_base-before.txt $pkg_list_base-after.txt > $pkg_list_base-diff.txt | |
echo " | |
Package diff: | |
" | |
cat $pkg_list_base-diff.txt | |
echo " | |
Uploading to $LOGBOOK | |
" | |
python -c "from pyOlog.cli.ipy import olog; \ | |
from pyOlog.OlogDataTypes import Attachment; \ | |
import os; \ | |
olog(msg='conda $*', \ | |
logbooks='$LOGBOOK', \ | |
attachments=[Attachment(open('$pkg_list_base-before.txt', 'r')), \ | |
Attachment(open('$pkg_list_base-after.txt', 'r')), \ | |
Attachment(open('$pkg_list_base-diff.txt', 'r'))])" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment