11/*
22 * dart-sass.ts
33 *
4- * Copyright (C) 2020-2022 Posit Software, PBC
4+ * Copyright (C) 2020-2025 Posit Software, PBC
55 */
66import { join } from "../deno_ral/path.ts" ;
77
@@ -58,10 +58,10 @@ export async function dartCompile(
5858 */
5959export interface DartCommandOptions {
6060 /**
61- * Override the path to the dart-sass install directory.
61+ * Override the dart-sass install directory.
6262 * Used for testing with non-standard paths (spaces, accented characters).
6363 */
64- sassPath ?: string ;
64+ installDir ?: string ;
6565}
6666
6767/**
@@ -86,8 +86,11 @@ function resolveSassCommand(options?: DartCommandOptions): {
8686 cmd : string ;
8787 baseArgs : string [ ] ;
8888} {
89- const sassPath = options ?. sassPath ;
90- if ( sassPath == null ) {
89+ const installDir = options ?. installDir ;
90+ if ( installDir == null ) {
91+ // Only check env var override when no explicit installDir is provided.
92+ // If QUARTO_DART_SASS doesn't exist on disk, fall through to use the
93+ // bundled dart-sass at the default architectureToolsPath.
9194 const dartOverrideCmd = Deno . env . get ( "QUARTO_DART_SASS" ) ;
9295 if ( dartOverrideCmd ) {
9396 if ( ! existsSync ( dartOverrideCmd ) ) {
@@ -100,7 +103,7 @@ function resolveSassCommand(options?: DartCommandOptions): {
100103 }
101104 }
102105
103- const sassDir = sassPath ?? architectureToolsPath ( "dart-sass" ) ;
106+ const sassDir = installDir ?? architectureToolsPath ( "dart-sass" ) ;
104107
105108 if ( isWindows ) {
106109 return {
0 commit comments