Revised prepare_env with extra options for unstowing stow
This commit is contained in:
parent
7439d611ea
commit
4b07b65b9d
1 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -z "$STORAGE" ]; then
|
if [ -z "$STORAGE" ]; then
|
||||||
echo "\$STORAGE is empty, please set it as a directory"
|
echo "\$STORAGE is empty, please set it as a directory"
|
||||||
|
@ -7,7 +8,7 @@ fi
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Prepare stow (perl libs and binary) - if necessary
|
# Prepare stow (perl libs and binary) - if necessary
|
||||||
if [ ! -f "$(which stow)" ]; then
|
if [ ! -f "$(which stow > /dev/null 2> /dev/null)" ]; then
|
||||||
mkdir -p $HOME/.local/{bin,share/{doc,info,man/man8,perl5}}
|
mkdir -p $HOME/.local/{bin,share/{doc,info,man/man8,perl5}}
|
||||||
|
|
||||||
ln -s $STORAGE/stowed/stow/.local/bin/stow $HOME/.local/bin
|
ln -s $STORAGE/stowed/stow/.local/bin/stow $HOME/.local/bin
|
||||||
|
@ -23,6 +24,12 @@ stow_dir=$STORAGE/stowed
|
||||||
# Restore stowed config
|
# Restore stowed config
|
||||||
cd $stow_dir
|
cd $stow_dir
|
||||||
|
|
||||||
|
# The stow folder needs to be unstowed with a special command
|
||||||
|
$stow --defer=.local/bin --defer=.local/share/perl5
|
||||||
|
|
||||||
|
# You can use the option --adopt to override config files
|
||||||
|
# that may autogenerate, such as .bashrc
|
||||||
|
|
||||||
# Copy this example, changing the folder to be restored
|
# Copy this example, changing the folder to be restored
|
||||||
# $stow bash
|
# $stow bash
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue