File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import { execProcess } from "./process.ts";
1111import { TempContext } from "./temp.ts" ;
1212import { lines } from "./text.ts" ;
1313import { info } from "log/mod.ts" ;
14+ import { existsSync } from "fs/mod.ts" ;
15+ import { warnOnce } from "./log.ts" ;
1416
1517export function dartSassInstallDir ( ) {
1618 return toolsPath ( "dart-sass" ) ;
@@ -51,8 +53,23 @@ export async function dartCompile(
5153}
5254
5355async function dartCommand ( args : string [ ] ) {
54- const command = Deno . build . os === "windows" ? "sass.bat" : "sass" ;
55- const sass = toolsPath ( join ( "dart-sass" , command ) ) ;
56+ const resolvePath = ( ) => {
57+ const dartOverrideCmd = Deno . env . get ( "QUARTO_DART_SASS" ) ;
58+ if ( dartOverrideCmd ) {
59+ if ( ! existsSync ( dartOverrideCmd ) ) {
60+ warnOnce (
61+ `Specified QUARTO_DART_SASS does not exist, using built in dart sass.` ,
62+ ) ;
63+ } else {
64+ return dartOverrideCmd ;
65+ }
66+ }
67+
68+ const command = Deno . build . os === "windows" ? "sass.bat" : "sass" ;
69+ return toolsPath ( join ( "dart-sass" , command ) ) ;
70+ } ;
71+ const sass = resolvePath ( ) ;
72+
5673 const cmd = [
5774 sass ,
5875 ...args ,
You can’t perform that action at this time.
0 commit comments