-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can GNU Stow use a stow target directory that is a symbolic link? #83
Comments
Sorry I can't reproduce this. I get:
which is also unsurprising because the
indicates a relative symlink, but your setup creates absolute symlinks. Please can you paste the exact sequence of commands you used, and the full output from Stow, not just select lines? |
@aspiers Sorry, I missed the package name. I reproduced it again, this is my script and output log. #!/usr/bin/env sh
base_dir="$(dirname -- "$(realpath $0)")"/stow-test-symbolic-link
target="${base_dir}"
app_name="app"
app_ver="0.36.2"
rm -rf "${base_dir}"
echo "${base_dir}" "${app_name}" "${app_ver}"
mkdir -p "${base_dir}"/{Cellar,opt,etc,dotfiles}
# create source file with version
mkdir -p "${base_dir}"/Cellar/"${app_name}"/"${app_ver}"/{bin,etc}
touch "${base_dir}"/Cellar/"${app_name}"/"${app_ver}"/{LICENSE,README.md}
touch "${base_dir}"/Cellar/"${app_name}"/"${app_ver}"/bin/cmd
touch "${base_dir}"/Cellar/"${app_name}"/"${app_ver}"/etc/cmd.conf.example
# create symbolic link folder without version
ln -snf "${base_dir}"/Cellar/"${app_name}"/"${app_ver}" "${base_dir}"/opt/"${app_name}"
# create app config in dotfiles
mkdir -p "${base_dir}"/dotfiles/"${app_name}"-config/{opt,etc}/"${app_name}"
touch "${base_dir}"/dotfiles/"${app_name}"-config/opt/"${app_name}"/homebrew.mxcl."${app_name}".plist
touch "${base_dir}"/dotfiles/"${app_name}"-config/etc/"${app_name}"/cmd.conf
echo ""
echo "########################################################################"
echo "########## file structure - before stow ##########"
echo "########################################################################"
echo ""
tree -a "${base_dir}"
echo ""
echo "########################################################################"
echo "########## stow use target directory that is normal directory ##########"
echo "########################################################################"
echo ""
stow -S --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config/opt --target="${target}"/opt/"${app_name}" "${app_name}"
[[ -d "${target}"/etc/"${app_name}" ]] || mkdir "${target}"/etc/"${app_name}"
stow -S --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config/etc --target="${target}"/etc/"${app_name}" "${app_name}"
tree -a "${base_dir}"
stow -D --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config/opt --target="${target}"/opt/"${app_name}" "${app_name}"
stow -D --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config/etc --target="${target}"/etc/"${app_name}" "${app_name}"
echo ""
echo "########################################################################"
echo "########## stow use target directory that is a symbolic link ##########"
echo "########################################################################"
echo ""
# "${target}"/opt/"${app_name}" is a symbolic link
stow -S -v5 -n --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config --target="${target}"/opt opt
[[ -d "${target}"/etc/"${app_name}" ]] && rm -rf "${target}"/etc/"${app_name}"
stow -S --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config --target="${target}"/etc etc
tree -a "${base_dir}"
# stow -D -v5 -n --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config --target="${target}"/opt opt
stow -D --no-folding --dir="${base_dir}"/dotfiles/"${app_name}"-config --target="${target}"/etc etc
I don't want to create stow link for the directory, but to create stow link for all files. |
Output
The text was updated successfully, but these errors were encountered: