From 8b9521d5a5d34bf81c57e901286ac325da2c1fc0 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Thu, 30 Jan 2020 14:57:14 +0000 Subject: [PATCH] Fix beta deployment --- gulpfile.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 9ff654b7..66966617 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -294,7 +294,7 @@ const options = { }, }, demo: { - uploadPath: branch.current === branch.beta ? 'beta' : null, + uploadPath: branch.current === branch.beta ? '/beta' : null, headers: { 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0', }, @@ -461,6 +461,14 @@ gulp.task('demo', done => { return gulp .src(pages) .pipe(replace(localPath, versionPath)) + .pipe( + rename(p => { + if (options.demo.uploadPath) { + // eslint-disable-next-line no-param-reassign + p.dirname += options.demo.uploadPath; + } + }), + ) .pipe(publisher.publish(options.demo.headers)) .pipe(publish.reporter()); });