File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ export async function prepareDist(
105105
106106 // build quarto-preview.js
107107 info ( "Building Quarto Web UI" ) ;
108- const result = buildQuartoPreviewJs ( config . directoryInfo . src ) ;
108+ const result = buildQuartoPreviewJs ( config . directoryInfo . src , undefined , true ) ;
109109 if ( ! result . success ) {
110110 throw new Error ( ) ;
111111 }
Original file line number Diff line number Diff line change 66
77import { join } from "path/mod.ts" ;
88
9- export function buildQuartoPreviewJs ( srcDir : string , denoDir ?: string ) {
9+ export function buildQuartoPreviewJs (
10+ srcDir : string ,
11+ denoDir ?: string ,
12+ force ?: boolean ,
13+ ) {
14+ const args = [ "run" , "-A" , "build.ts" ] ;
15+ if ( force ) {
16+ args . push ( "--force" ) ;
17+ }
1018 const buildCmd = new Deno . Command ( Deno . execPath ( ) , {
11- args : [ "run" , "-A" , "build.ts" ] ,
19+ args : args ,
1220 cwd : quartoPreviewJsDir ( srcDir ) ,
1321 env : denoDir ? { DENO_DIR : denoDir } : undefined ,
1422 stderr : "inherit" ,
Original file line number Diff line number Diff line change 11// ensure this is treated as a module
22export { } ;
33
4+ const args = Deno . args ;
5+
46// establish target js build time
57const kQuartoPreviewJs = "../../resources/preview/quarto-preview.js" ;
68let jsBuildTime : number ;
1113}
1214
1315// check if any of our repo files have a later time
14- let build = false ;
16+ let build = args . length > 0 && args . includes ( "--force" ) ;
1517try {
1618 const command = new Deno . Command ( "git" , { args : [ "ls-files" ] } ) ;
1719 const cmdOutput = await command . output ( ) ;
2123 build = files . some ( ( file ) =>
2224 Deno . statSync ( file ) . mtime ! . valueOf ( ) > jsBuildTime
2325 ) ;
24- } else {
26+ } else {
2527 // not in a git repo, rebuild
2628 build = true ;
2729 }
You can’t perform that action at this time.
0 commit comments