pidgin/nest

Add optional path

2019-05-29, Jason
b6ca8b56840c
Parents f1faf9a5483a
Children a261f7a545f0
Add optional path
overide to pre-prod tool
--- a/tools/pre-prod.js Tue May 28 04:04:37 2019 +0000
+++ b/tools/pre-prod.js Wed May 29 23:07:11 2019 +0100
@@ -1,6 +1,8 @@
/**
* Runs after Hugo has built the site
* * Cleans, Minifies and Optimises hugo output
+ *
+ * USAGE: node tools/pre-prod [path to hugo output]
*/
/*****************************************************************************
@@ -17,7 +19,9 @@
* Set Up
*****************************************************************************/
-const target = path.join(__dirname, '../public/')
+const target =
+ // looks for a path in first arg or default to `./public/`
+ path.join(__dirname, `..`, process.argv[2] || 'public') + path.sep
const svgo = new SVGO()
const xmlRegex = /\.(html|xml)$/
@@ -45,7 +49,7 @@
*****************************************************************************/
/**
- * Format XML and HTML, removing hugo template artefacts,
+ * Format XML and HTML, removing hugo template artefacts,
* like whitespace chasms
* @param {string} path
*/