Bash script to Stow Linux configuration files not working with files in root of home or existing folders -
basically, trying use gnu stow
sync dotfiles / config files home directory. each config stored in named folder relative home directory. example, vim/.vimrc
or i3/.config/i3/config
. of these folders have multiple files.
script
#!/usr/bin/env bash # script stow dotfiles located in ~/dotfiles folder. # -r flag used force 'restow' remove existing symlinks before attempting stow. echo "stowing dotfiles..."; cd ~/.dotfiles file in ~/dotfiles/*; # run stow on directories in dotfiles folder , not individual files. # using 'basename' strips filepath directory name. if [ -d ${file} ]; stow -r $(basename $file) echo "$(basename $file) stowed."; fi done # return pwd before ran script cd ~- echo 'all stowed';
when run files or directories in ~/.config
folder stowed. however, if file exists not seem stowed. also, files in root of home directory not seem stowed, such bash/.bashrc
, other files in said dir.
output
stowing dotfiles... stow_all.sh: line 8: cd: /home/devon/.dotfiles: no such file or directory warning! unstowing bash cause conflicts: * existing target neither link nor directory: .bash_aliases * existing target neither link nor directory: .bashrc warning! stowing bash cause conflicts: * existing target neither link nor directory: .bash_aliases * existing target neither link nor directory: .bashrc operations aborted. bash stowed. bin stowed. compton stowed. warning! unstowing fonts cause conflicts: * existing target neither link nor directory: .local/share/fonts/roboto mono bold italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono bold powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono light italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono light powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono medium italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono medium powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono thin italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono thin powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono powerline.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-bold.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-bolditalic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-italic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-light.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-lightitalic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-medium.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-mediumitalic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-regular.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-thin.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-thinitalic.ttf warning! stowing fonts cause conflicts: * existing target neither link nor directory: .local/share/fonts/roboto mono bold italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono bold powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono light italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono light powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono medium italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono medium powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono thin italic powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono thin powerline.ttf * existing target neither link nor directory: .local/share/fonts/roboto mono powerline.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-bold.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-bolditalic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-italic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-light.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-lightitalic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-medium.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-mediumitalic.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-regular.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-thin.ttf * existing target neither link nor directory: .local/share/fonts/robotomono-thinitalic.ttf operations aborted. fonts stowed. warning! unstowing git cause conflicts: * existing target neither link nor directory: .gitconfig warning! stowing git cause conflicts: * existing target neither link nor directory: .gitconfig operations aborted. git stowed. gtk stowed. i3 stowed. warning! unstowing ncmpcpp cause conflicts: * existing target neither link nor directory: .config/ncmpcpp/config warning! stowing ncmpcpp cause conflicts: * existing target neither link nor directory: .config/ncmpcpp/config operations aborted. ncmpcpp stowed. warning! unstowing polybar cause conflicts: * existing target neither link nor directory: .config/polybar/config * existing target neither link nor directory: .config/polybar/launch.sh * existing target neither link nor directory: .config/polybar/updates.sh * existing target neither link nor directory: .config/polybar/weather.py warning! stowing polybar cause conflicts: * existing target neither link nor directory: .config/polybar/config * existing target neither link nor directory: .config/polybar/launch.sh * existing target neither link nor directory: .config/polybar/updates.sh * existing target neither link nor directory: .config/polybar/weather.py operations aborted. polybar stowed. ranger stowed. sound stowed. warning! unstowing termite cause conflicts: * existing target neither link nor directory: .config/termite/config warning! stowing termite cause conflicts: * existing target neither link nor directory: .config/termite/config operations aborted. termite stowed. warning! unstowing tmux cause conflicts: * existing target neither link nor directory: .tmux.conf warning! stowing tmux cause conflicts: * existing target neither link nor directory: .tmux.conf operations aborted. tmux stowed. warning! unstowing vim cause conflicts: * existing target neither link nor directory: .tern-config * existing target neither link nor directory: .vimrc warning! stowing vim cause conflicts: * existing target neither link nor directory: .tern-config * existing target neither link nor directory: .vimrc operations aborted. vim stowed. warning! unstowing xorg cause conflicts: * existing target neither link nor directory: .xresources * existing target neither link nor directory: .xinitrc warning! stowing xorg cause conflicts: * existing target neither link nor directory: .xresources * existing target neither link nor directory: .xinitrc operations aborted. xorg stowed. stowed
Comments
Post a Comment