aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts
index 7d018fe..6749ae1 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -38,16 +38,27 @@ const bashTemplate = {
outputFile: path.join(HOST_DIR, "bash"),
context: { TARGET_URL }
} as Template;
+const indexTemplate = {
+ inputFile: path.join(__dirname, "..", "public", "index.html.template"),
+ outputFile: path.join(HOST_DIR, "index.html"),
+ context: { TARGET_URL }
+} as Template;
+
processTemplate(bashTemplate)
.then(template => {
logger.debug("Generated '%s' from template file", template.outputFile);
})
+ .then(() => processTemplate(indexTemplate))
+ .then(template => {
+ logger.debug("Generated '%s' from template file", template.outputFile);
+ })
.catch(err => {
logger.error("Unable to process template file: %s", err);
// if the output file exists, then we are fine with continuing without
return fs.promises.access(bashTemplate.outputFile, fs.constants.R_OK);
})
+ .then(() => fs.promises.access(indexTemplate.outputFile, fs.constants.R_OK))
.catch(err => {
logger.error("Cannot proceed: %s", err);