#!/usr/bin/env bash create-symlink-dir() { local source_dir="$1" local target_dir="$2" # Remove existing directory if it exists if [[ -e "$target_dir" || -L "$target_dir" ]]; then rm -rf "$target_dir" fi # Create parent directory if needed local parent_dir=$(dirname "$target_dir") ensure-directory "$parent_dir" # Create symlink to directory ln -sf "$source_dir" "$target_dir" }