mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-04-26 23:53:42 +02:00
fix: stow utils
This commit is contained in:
parent
44560581d0
commit
a4beed1e30
3 changed files with 12 additions and 4 deletions
|
@ -4,11 +4,15 @@ create_links() {
|
||||||
local source_dir=$1
|
local source_dir=$1
|
||||||
local target_dir=$2
|
local target_dir=$2
|
||||||
|
|
||||||
if [ ! -d "$source_dir" ] || [ ! -d "$target_dir" ]; then
|
if [ ! -d $source_dir ]; then
|
||||||
echo "Source or target directory does not exist."
|
echo "Source directory does not exist."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d $target_dir ]; then
|
||||||
|
mkdir -p $target_dir
|
||||||
|
fi
|
||||||
|
|
||||||
for item in "$source_dir"/* "$source_dir"/.*; do
|
for item in "$source_dir"/* "$source_dir"/.*; do
|
||||||
if [ -e "$item" ] && [ "$item" != "$source_dir/." ] && [ "$item" != "$source_dir/.." ]; then
|
if [ -e "$item" ] && [ "$item" != "$source_dir/." ] && [ "$item" != "$source_dir/.." ]; then
|
||||||
echo "$item ===> $target_dir"
|
echo "$item ===> $target_dir"
|
||||||
|
@ -21,7 +25,7 @@ delete_links() {
|
||||||
local source_dir=$1
|
local source_dir=$1
|
||||||
local target_dir=$2
|
local target_dir=$2
|
||||||
|
|
||||||
if [ ! -d "$source_dir" ] || [ ! -d "$target_dir" ]; then
|
if [ ! -d $source_dir ] || [ ! -d $target_dir ]; then
|
||||||
echo "Source or target directory does not exist."
|
echo "Source or target directory does not exist."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8485498ac8a213f968cb7e18c8337814542fec70
|
Subproject commit 4a153019a337b308b72fc366e6314d3b2545c5da
|
4
stow.sh
4
stow.sh
|
@ -7,6 +7,7 @@ DOTS_CONFIG_DIR="$(pwd)/linux-configs"
|
||||||
DOTFILES_DIR="$DOTS_CONFIG_DIR/dotfiles"
|
DOTFILES_DIR="$DOTS_CONFIG_DIR/dotfiles"
|
||||||
|
|
||||||
SHELL_DIR="$DOTS_CONFIG_DIR/shells/zsh"
|
SHELL_DIR="$DOTS_CONFIG_DIR/shells/zsh"
|
||||||
|
FISH_DIR="$DOTS_CONFIG_DIR/shells/fish"
|
||||||
|
|
||||||
EDITOR_DIR="$DOTS_CONFIG_DIR/editor/vim"
|
EDITOR_DIR="$DOTS_CONFIG_DIR/editor/vim"
|
||||||
|
|
||||||
|
@ -34,6 +35,9 @@ stow() {
|
||||||
create_links $SHELL_DIR ~
|
create_links $SHELL_DIR ~
|
||||||
log "Shell stowed successfully!"
|
log "Shell stowed successfully!"
|
||||||
|
|
||||||
|
create_links $FISH_DIR ~/.config/fish
|
||||||
|
log "Fish Shell stowed successfully!"
|
||||||
|
|
||||||
create_links $EDITOR_DIR ~
|
create_links $EDITOR_DIR ~
|
||||||
log "Editor stowed successfully!"
|
log "Editor stowed successfully!"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue