Skip to content

Commit d2bab89

Browse files
authored
Merge pull request #8882 from dragonstyle/bugfix/8873
Project Create - Don’t Overwrite Supporting
2 parents f57620e + 140787a commit d2bab89

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

news/changelog-1.5.md

+1
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,6 @@ All changes included in 1.5:
9898
- ([#8540](https://github.com/quarto-dev/quarto-cli/issues/8540)): Allow title to be specifed separately when creating a project
9999
- ([#8652](https://github.com/quarto-dev/quarto-cli/issues/8652)): Make code cell detection in IDE tooling consistent across editor modes.
100100
- ([#8779](https://github.com/quarto-dev/quarto-cli/issues/8779)): Resolve shortcode includes before engine and target determination.
101+
- ([#8873](https://github.com/quarto-dev/quarto-cli/issues/8873)): Don't overwrite supporting files when creating a project.
101102
- Add support for `{{< lipsum >}}` shortcode, which is useful for emitting placeholder text. Specify a specific number of paragraphs (`{{< lipsum 3 >}}`).
102103
- 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).

src/project/project-create.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ export async function projectCreate(options: ProjectCreateOptions) {
137137
dest = join(options.dir, supporting.to);
138138
displayName = supporting.to;
139139
}
140-
141-
ensureDirSync(dirname(dest));
142-
copyTo(src, dest);
143-
if (!options.quiet) {
144-
info("- Created " + displayName, { indent: 2 });
140+
if (!existsSync(dest)) {
141+
ensureDirSync(dirname(dest));
142+
copyTo(src, dest);
143+
if (!options.quiet) {
144+
info("- Created " + displayName, { indent: 2 });
145+
}
145146
}
146147
}
147148
}

0 commit comments

Comments
 (0)