Skip to content
Open
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
4 changes: 4 additions & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ All changes included in 1.9:

## Commands

### `use template`

- ([#14008](https://github.com/quarto-dev/quarto-cli/issues/14008)): Fix `quarto use template` failing to install extensions from GitHub organisation repositories when the extension was scoped with the organisation (e.g., `quarto-journals/acm`). (author: @mcanouil)

### `use brand`

- ([#13828](https://github.com/quarto-dev/quarto-cli/pull/13828)): New `quarto use brand` command copies and synchronizes the `_brand/` directory from a repo, directory, or ZIP file. See [the prerelease documentation](https://prerelease.quarto.org/docs/authoring/brand.html#quarto-use-brand) for details.
Expand Down
2 changes: 1 addition & 1 deletion src/command/use/commands/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async function useTemplate(
// Copy the extensions into a substaging directory
// this will ensure that they are namespaced properly
const subStagedDir = tempContext.createDir();
await copyExtensions(source, stagedDir, subStagedDir);
await copyExtensions(source, extDir, subStagedDir);

// Now complete installation from this sub-staged directory
await completeInstallation(subStagedDir, outputDirectory);
Expand Down
50 changes: 26 additions & 24 deletions tests/smoke/use/template.test.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
import { testQuartoCmd } from "../../test.ts";
import { directoryContainsOnlyAllowedPaths, fileExists, folderExists, noErrorsOrWarnings, printsMessage } from "../../verify.ts";
import { directoryContainsOnlyAllowedPaths, fileExists, noErrorsOrWarnings, printsMessage } from "../../verify.ts";
import { join } from "../../../src/deno_ral/path.ts";
import { ensureDirSync } from "../../../src/deno_ral/fs.ts";

const tempDir = Deno.makeTempDirSync();

const templateFolder = "article";
const workingDir = join(tempDir, templateFolder);
const extensionsDir = join(workingDir, "_extensions");
ensureDirSync(workingDir);
testQuartoCmd(
"use",
["template", "quarto-journals/jasa", "--no-prompt"],
[noErrorsOrWarnings, fileExists(`${templateFolder}.qmd`), folderExists(extensionsDir)],
{
setup: () => {
return Promise.resolve();
},
cwd: () => {
return workingDir;
},
teardown: () => {
try {
Deno.removeSync(workingDir, {recursive: true});
} catch {
for (const ext of ["jasa", "acm"]) {
const templateFolder = `${ext}-article`;
const workingDir = join(tempDir, templateFolder);
const extensionYml = join(workingDir, "_extensions", "quarto-journals", ext, "_extension.yml");
ensureDirSync(workingDir);
testQuartoCmd(
"use",
["template", `quarto-journals/${ext}`, "--no-prompt"],
[noErrorsOrWarnings, fileExists(`${templateFolder}.qmd`), fileExists(extensionYml)],
{
setup: () => {
return Promise.resolve();
},
cwd: () => {
return workingDir;
},
teardown: () => {
try {
Deno.removeSync(workingDir, {recursive: true});
} catch {

}
return Promise.resolve();
}
return Promise.resolve();
}
}
)
)
}

const nonEmptyTemplateFolder = "notempty";
const nonEmptyFileName = `${nonEmptyTemplateFolder}.qmd`;
Expand All @@ -52,7 +54,7 @@ testQuartoCmd(
try {
Deno.removeSync(nonEmptyWorkingDir, {recursive: true});
} catch {

}
return Promise.resolve();
}
Expand Down
Loading