From d5c77d41dfa3b7803c1699832e96135412df8aa0 Mon Sep 17 00:00:00 2001 From: james hadfield Date: Tue, 14 Jul 2020 15:35:50 +1200 Subject: [PATCH] [bugfix] allow `auspice view` to work with custom auspice clients When running `auspice view` there is some logic to ask if we have a customised client bundle present, which we should serve, or whether we should serve the vanilla (default) auspice client. PR #1126 introduced hashes into the (client) JS bundle names, which resulted in this logic missing when there was a customised client present, so we would always fall back to the vanilla auspice client. --- cli/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/view.js b/cli/view.js index e6ba4ff3c..da287558e 100644 --- a/cli/view.js +++ b/cli/view.js @@ -82,7 +82,7 @@ const getAuspiceBuild = () => { cwd !== sourceDir && fs.existsSync(path.join(cwd, "index.html")) && fs.existsSync(path.join(cwd, "dist")) && - fs.existsSync(path.join(cwd, "dist", "auspice.bundle.js")) + fs.readdirSync(path.join(cwd, "dist")).filter((fn) => fn.match(/^auspice.bundle.[a-z0-9]+.js$/)).length === 1 ) { return { message: "Serving the auspice build which exists in this directory.",