Skip to content

Commit

Permalink
added dump_installed_pkgs.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
br-cpvc committed Jun 16, 2022
1 parent 76e420b commit 6987301
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions dump_installed_pkgs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
ts=$(date -u '+%Y%m%d-%H%M%S')
dstdir="pkgs_installed/$ts"
mkdir -p $dstdir
echo "dumping to folder: $dstdir"

if [ -x "$(command -v apt)" ]; then
dstfile="$dstdir/apt.txt"
echo "writing: $dstfile"
apt list --installed > $dstfile
fi

if [ -x "$(command -v pip)" ]; then
dstfile="$dstdir/pip.txt"
echo "writing: $dstfile"
pip list > $dstfile
fi

# should we also do sudo pip

if [ -x "$(command -v brew)" ]; then
dstfile="$dstdir/brew.txt"
echo "writing: $dstfile"
brew list --versions > $dstfile
fi

if [ -x "$(command -v conda)" ]; then
dstfile="$dstdir/conda.txt"
echo "writing: $dstfile"
conda env export --name base > $dstfile
fi

if [ -x "$(command -v snap)" ]; then
dstfile="$dstdir/snap.txt"
echo "writing: $dstfile"
snap list > $dstfile
fi

if [ -x "$(command -v flatpak)" ]; then
dstfile="$dstdir/flatpak.txt"
echo "writing: $dstfile"
flatpak list > $dstfile
fi

0 comments on commit 6987301

Please sign in to comment.