feat: add methods to backup and restore Python environment

This commit is contained in:
Stefan Imhoff
2023-01-12 19:36:48 +01:00
parent e2dd5a3540
commit ad05d8420a
3 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
function pythonBackup --description "Python backup"
pip freeze > ~/.dotfiles/python/pip-requirements.txt
end

View File

@@ -0,0 +1,3 @@
function pythonRestore --description "Install Python packages"
pip install -r ~/.dotfiles/python/pip-requirements.txt
end

View File

@@ -141,6 +141,14 @@ function homebrewRestore () {
brew bundle --file ~/.dotfiles/Brewfile
}
function pythonBackup () {
pip freeze > ~/.dotfiles/python/pip-requirements.txt
}
function pythonRestore () {
pip install -r ~/.dotfiles/python/pip-requirements.txt
}
# Encode images in Base64
encodeBase64() {
uuencode -m $1 /dev/stdout | sed '1d' | sed '$d'