From 8c815f320d138b3c30752863d7276b60a3b07c83 Mon Sep 17 00:00:00 2001 From: juliandescottes Date: Sun, 7 May 2017 02:00:09 +0200 Subject: [PATCH] copy version file to piskel website --- bin/copy-to-piskel-website.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bin/copy-to-piskel-website.js b/bin/copy-to-piskel-website.js index 02933cc6..8e15af9f 100644 --- a/bin/copy-to-piskel-website.js +++ b/bin/copy-to-piskel-website.js @@ -6,6 +6,8 @@ const fse = require('fs-extra'); const PISKEL_PATH = path.resolve(__dirname, '..'); const PISKELAPP_PATH = path.resolve(__dirname, '../../piskel-website'); +var pjson = require('../package.json'); + // Callbacks sorted by call sequence. function onCopy(err) { if (err) { @@ -52,6 +54,17 @@ function onDeleteTempPartial(err) { } console.log('Temporary main partial deleted...'); + + fs.writeFile(path.resolve(PISKELAPP_PATH, "static/editor/VERSION"), pjson.version, onVersionFileCreated); +} + +function onVersionFileCreated(err) { + if (err) { + console.error('Failed to create temporary main partial...'); + return console.error(err); + } + + console.log('Version file created...'); console.log('Finished!'); }