Skip to content
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

Symlinks not generated from templates #776

Open
2 tasks done
bahildebrand opened this issue Nov 3, 2022 · 1 comment
Open
2 tasks done

Symlinks not generated from templates #776

bahildebrand opened this issue Nov 3, 2022 · 1 comment

Comments

@bahildebrand
Copy link

Describe the bug
Symlinks are not copied if they exist in a template, or are generated from a rhai script. I've tried both the symlink being present in the template, and generating one with rhai. The behavior with rhai is a bit different, as I see output indicating that the file was copied(i.ie [ 6/16] Done: path/to/symlink), while a symlink file present in the template does not.

Relevant Rhai snippet:

system::command("ln", ["-s", "/usr/bin/some-bin", "path/to/symlink])

At first I thought they might be failing since I'm creating a link outside of the template directory, but even creating links local to the template do not seem to copy properly.

make sure you

  • I'm on the latest rust version rustup update
  • I'm on the latest cargo-generate version cargo install cargo-generate

To Reproduce
Steps to reproduce the behavior:

  1. cargo generate -a -p template_dir - with symlink present in template

Expected behavior
Symlinks copied to template output

Desktop (please complete the following information):

  • OS: Fedora
  • Version: 36
  • Build tools: cargo
  • Shell: zsh
  • rustc --version: 1.65
  • cargo generate --version: 0.16.0
@x37v
Copy link

x37v commented Dec 2, 2022

I am experiencing similar behavior, I have a template that has a symlinked directory in it, I would like the directory and its contents to end up in the project that cargo-generate produces. I have tried adding explicit include entries for each of the files in the symlinked folder, an explicit include for the folder itself, nothing seems to work. I also don't get a warning when I generate a project from the template.

rustc 1.65.0 (897e37553 2022-11-02)
cargo generate 0.17.3

x37v added a commit to Cycling74/median that referenced this issue Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants