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

Project Create - Don’t Overwrite Supporting #8882

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@ All changes included in 1.5:
- ([#8540](https://github.com/quarto-dev/quarto-cli/issues/8540)): Allow title to be specifed separately when creating a project
- ([#8652](https://github.com/quarto-dev/quarto-cli/issues/8652)): Make code cell detection in IDE tooling consistent across editor modes.
- ([#8779](https://github.com/quarto-dev/quarto-cli/issues/8779)): Resolve shortcode includes before engine and target determination.
- ([#8873](https://github.com/quarto-dev/quarto-cli/issues/8873)): Don't overwrite supporting files when creating a project.
- Add support for `{{< lipsum >}}` shortcode, which is useful for emitting placeholder text. Specify a specific number of paragraphs (`{{< lipsum 3 >}}`).
- Increase v8's max heap size by default, to avoid out-of-memory errors when rendering large documents (also cf. https://github.com/denoland/deno/issues/18935).
11 changes: 6 additions & 5 deletions src/project/project-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ export async function projectCreate(options: ProjectCreateOptions) {
dest = join(options.dir, supporting.to);
displayName = supporting.to;
}

ensureDirSync(dirname(dest));
copyTo(src, dest);
if (!options.quiet) {
info("- Created " + displayName, { indent: 2 });
if (!existsSync(dest)) {
ensureDirSync(dirname(dest));
copyTo(src, dest);
if (!options.quiet) {
info("- Created " + displayName, { indent: 2 });
}
}
}
}
Expand Down
Loading