diff --git a/configuration.js b/classes/Configuration.js similarity index 78% rename from configuration.js rename to classes/Configuration.js index 5bcce8b..41a0366 100644 --- a/configuration.js +++ b/classes/Configuration.js @@ -4,39 +4,42 @@ const fs = require('fs-extra'); const path = require('path'); const inquirer = require('inquirer'); const Ajv = require('ajv'); -const ajv = new Ajv({verbose: true, extendRefs: true}); -var metaSchema = require('ajv/lib/refs/json-schema-draft-04.json'); -metaSchema.$id = metaSchema.id; -delete metaSchema.id -ajv.addMetaSchema(metaSchema); +const ajv = new Ajv({verbose: true}); const yargs = require('yargs'); -const axios = require('axios'); const logger = require('./logger'); +function readSchema (filename) { + return fs.readJsonSync(path.join(__dirname, `../config/schema/${filename}.schema.json`)); +} + class Configuration { constructor(rootPath, argv) { this.rootPath = rootPath; - - this._validateAppStructure(); - this.manifest = require(path.resolve(this.rootPath, 'manifest.json')); + // checks + this._validateAppStructure(); this._validateManifest(); this._validateCustomObjects(); - this._validateScripts(); - - this.bbugrcPath = path.join(process.cwd(), '.bbugrc'); + // login + this.host = argv.host; + this.port = argv.port; this.email = argv.email; this.password = argv.password; - this.host = argv.host; + + // install + this.clientId = '302e48d75f4b55016aaf2c81f5ddf80f039e3f863277'; this.companyId = argv.companyId && argv.companyId.toString(); - this.port = argv.port; + this.appId = this.manifest.unique_name; + + // webpack this.dev = argv.dev; - this.name = this.manifest.unique_name; - this.appId = '302e48d75f4b55016aaf2c81f5ddf80f039e3f863277'; + + // app config + this.bbugrcPath = path.join(process.cwd(), '.bbugrc'); this.configSchema = fs.readJsonSync(path.join(process.cwd(), 'config.json'), { throws: false }); } @@ -48,7 +51,7 @@ class Configuration { } _validateManifest(){ - const schema = fs.readJsonSync(path.join(__dirname, './schema/manifest.schema.json')); + const schema = readSchema('manifest'); const valid = ajv.validate(schema, this.manifest); if (!valid) { logger.fatal('manifest.json validation error'); @@ -58,24 +61,13 @@ class Configuration { } _validateCustomObjects() { - this._validate('object/manifest.schema.json', 'objects', 'manifest.json'); - this._validate('object/fields.schema.json', 'objects', 'fields.json'); - this._validate('object/relations.schema.json', 'objects', 'relations.json'); - } - - _validateScripts() { - this._validate('script/manifest.schema.json', 'script_packs', 'manifest.json'); - } - - _validate(schemaFile, type, file) { - const schema = fs.readJsonSync(path.join(__dirname, 'node_modules', '@bookingbug', 'app-manifest', schemaFile)); - if (this.manifest[type]) { - this.manifest[type].forEach((folder) => { - const filePath = path.join(process.cwd(), folder, file); - const fields = fs.readJsonSync(filePath); + const schema = readSchema('custom-object-fields'); + if (this.manifest.objects) { + this.manifest.objects.forEach((object) => { + const fields = fs.readJsonSync(path.join(process.cwd(), object, 'fields.json')); const valid = ajv.validate(schema, fields); if (!valid) { - logger.fatal(`${filePath} validation error`); + logger.fatal(`${object}/fields.json validation error`); logger.fatal(ajv.errorsText()); process.exit(0); } @@ -84,7 +76,7 @@ class Configuration { } isDev(){ - this.dev === true; + return this.dev === true; } _mapSchemaToQuestions(schema) { diff --git a/classes/logger.js b/classes/logger.js new file mode 100644 index 0000000..a7a175e --- /dev/null +++ b/classes/logger.js @@ -0,0 +1,11 @@ +const chalk = require('chalk') + +function indent (message) { + return message.trim().replace(/^/mg, ' ').replace(/^\s+/, '') +} + +const logger = {} +logger.info = (message) => console.log(`${chalk.blue('[INFO]')} ${indent(message)}`) +logger.warn = (message) => console.warn(chalk.yellow(`[WARN] ${indent(message)}`)) +logger.fatal = (message) => console.error(chalk.red(`[FATAL] ${indent(message)}`)) +module.exports = logger diff --git a/default-options.json b/config/options/login-options.json similarity index 100% rename from default-options.json rename to config/options/login-options.json diff --git a/new-options.json b/config/options/new-options.json similarity index 61% rename from new-options.json rename to config/options/new-options.json index 6990949..5c9eb8f 100644 --- a/new-options.json +++ b/config/options/new-options.json @@ -1,6 +1,6 @@ { - "name": { - "describe": "Name used to identify app", + "appId": { + "describe": "Application ID (unique_name)", "type": "string" }, "author": { diff --git a/config/schema/custom-object-fields.schema.json b/config/schema/custom-object-fields.schema.json new file mode 100644 index 0000000..333a7ae --- /dev/null +++ b/config/schema/custom-object-fields.schema.json @@ -0,0 +1,49 @@ +{ + "allOf": [ + { + "$ref": "http://json-schema.org/draft-07/schema#" + } + ], + "definitions": { + "objectField": { + "type": "object", + "required": [ + "key", + "type" + ], + "properties": { + "key": { + "type": "string", + "description": "object field key", + "example": "myfield" + }, + "type": { + "$ref": "http://json-schema.org/draft-07/schema#/definitions/simpleTypes" + }, + "length": { + "type": "integer", + "description": "The max length of a string field", + "example": "30" + }, + "default": { + "description": "The default value of the field", + "example": "value" + }, + "required": { + "type": "boolean", + "description": "If the feild is required when being created", + "example": true + }, + "drops": { + "type": "boolean", + "description": "If this field is available in liquid drops", + "example": true + } + } + } + }, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/objectField" + } +} diff --git a/config/schema/manifest.schema.json b/config/schema/manifest.schema.json new file mode 100644 index 0000000..81e9580 --- /dev/null +++ b/config/schema/manifest.schema.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "Representation of an App manifest for BB", + "type": "object", + "required": [ + "bbAppManifestVersion", + "version", + "name", + "unique_name" + ], + "properties": { + "bbAppManifestVersion": { + "type": "string", + "description": "BookignBug App manifest version", + "exmaple": "1.0" + }, + "name": { + "type":"string", + "description":"The name of the app", + "example":"Test App" + }, + "unique_name": { + "type":"string", + "description":"The unique name of the app, this must have no spaces", + "example":"TestApp" + }, + "description": { + "type":"string", + "description":"A description of your app in markdown", + "example":"My test app" + }, + "version": { + "type":"string", + "description":"An app version number", + "example":"1.0" + }, + "author": { + "type":"string", + "description":"The name of the author or authors", + "example":"John Doe" + }, + "licence": { + "type":"string", + "description":"A Licence message", + "example":"GPLv3" + }, + "tags": { + "type":"string", + "description":"A comma seperated list of tags for the app", + "example":"" + }, + "panels": { + "type":"array", + "uniqueItems": true, + "description":"", + "items": { + "type": "string" + } + }, + "scripts": { + "type":"array", + "uniqueItems": true, + "description":"", + "items": { + "type": "string" + } + }, + "objects": { + "type":"array", + "uniqueItems": true, + "description":"", + "items": { + "type": "string" + } + }, + "config": { + "type":"boolean", + "description":"If there is a config block/schema for this app to be asked on install", + "example": true + } + } +} diff --git a/initialize.js b/initialize.js deleted file mode 100644 index 9c2fd6a..0000000 --- a/initialize.js +++ /dev/null @@ -1,44 +0,0 @@ -const fs = require('fs-extra'); -const path = require('path'); -const inquirer = require('inquirer'); - -const newOptions = require('./new-options.json'); -const logger = require('./logger'); - -const questions = Object.entries(newOptions).reduce((list, pair) => { - const [name, question] = pair; - list.push({ - type: 'input', - name: name, - message: question.describe - }) - return list -}, []); - -const filterQuestions = (argv) => { - return questions.filter(question => !argv.hasOwnProperty(question.name)); -} - -const createFiles = (argv) => { - logger.info('Started new app'); - fs.mkdirpSync(argv.dir); - const manifest = { - bbAppManifestVersion: '1.0', - name: argv.name, - author: argv.author, - panels: [], - objects: [], - scripts: [], - liquid: [] - } - fs.outputJsonSync(path.join(argv.dir,'manifest.json'), manifest, {spaces: 2}); - logger.info('Completed new app'); -} - -module.exports = (argv) => { - inquirer.prompt(filterQuestions(argv)).then(answers => { - argv = Object.assign(argv, answers); - createFiles(argv); - }); -} - diff --git a/logger.js b/logger.js deleted file mode 100644 index 9428588..0000000 --- a/logger.js +++ /dev/null @@ -1,7 +0,0 @@ -const chalk = require('chalk'); - -const logger = {}; -logger.info = (message) => console.log(`${chalk.blue('[INFO]')} ${message}`); -logger.warn = (message) => console.warn(chalk.yellow(`[WARN] ${message}`)); -logger.fatal = (message) => console.error(chalk.red(`[FATAL] ${message}`)); -module.exports = logger; diff --git a/index.js b/main.js similarity index 58% rename from index.js rename to main.js index b428a45..459e1b5 100755 --- a/index.js +++ b/main.js @@ -1,13 +1,13 @@ #!/usr/bin/env node -const install = require('./install'); -const initialize = require('./initialize'); -const tail = require('./tail'); -const logger = require('./logger'); -const uninstall = require('./uninstall'); +const install = require('./services/install'); +const initialize = require('./services/initialize'); +const tail = require('./services/tail'); +const logger = require('./classes/logger'); +const uninstall = require('./services/uninstall'); -const newOptions = require('./new-options.json'); -const defaultOptions = require('./default-options.json'); +const newOptions = require('./config/options/new-options.json'); +const loginOptions = require('./config/options/login-options.json'); const yargs = require('yargs'); const fs = require('fs-extra'); @@ -28,17 +28,16 @@ const tailBuilder = (tailYargs) => { describe: 'Name of script', type: 'string' }) - .options(defaultOptions) + .options(loginOptions) } const config = fs.readJsonSync(path.join(process.cwd(), '.bbugrc'), {throws: false}) || {}; yargs .usage('Usage: $0 ') - .command(['$0', 'install'], 'Package and install app', defaultOptions, install) + .command(['$0', 'install'], 'Package and install app', loginOptions, install) + .command('uninstall', 'Uninstall a app', loginOptions, uninstall) .command('new ', 'Initialize a new app', newBuilder, initialize) .command('tail', 'Show script logs', tailBuilder, tail) - .command('uninstall', 'Uninstall a app', defaultOptions, uninstall) .config(config) .argv; - diff --git a/package.json b/package.json index ce71562..10a47c6 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "@bookingbug/bbug-apps-cli", "version": "0.0.1", "description": "BookingBug Apps CLI", - "main": "index.js", - "bin": "./index.js", + "main": "main.js", + "bin": "./main.js", "pkg": { - "assets": "schema/*" + "assets": "config/schema/*" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -31,6 +31,7 @@ "babel-plugin-transform-optional-catch-binding": "~7.0.0-alpha.16", "babel-preset-env": "~1.7.0", "chalk": "~2.4.1", + "chokidar": "^2.0.4", "clean-webpack-plugin": "~0.1.19", "css-loader": "~1.0.1", "fast-sass-loader": "~1.4.6", diff --git a/authenticate.js b/services/authenticate.js similarity index 96% rename from authenticate.js rename to services/authenticate.js index a2b7db7..a133dd1 100644 --- a/authenticate.js +++ b/services/authenticate.js @@ -6,7 +6,7 @@ const util = require('util'); const writeFile = util.promisify(fs.writeFile); const axios = require('axios'); -const logger = require('./logger'); +const logger = require('../classes/logger'); async function promptForCompany(companies, configuration, cb) { const questions = [{ @@ -36,7 +36,7 @@ async function authenticate(configuration) { baseURL: `${protocol}://${configuration.host}:${configuration.port}`, data: data, headers: { - 'App-Id': configuration.appId, + 'App-Id': configuration.clientId, 'Content-Type': 'application/json', 'Content-Length': data.length }, diff --git a/bundle.js b/services/bundle.js similarity index 67% rename from bundle.js rename to services/bundle.js index d2d0cc0..484c7bf 100644 --- a/bundle.js +++ b/services/bundle.js @@ -4,15 +4,19 @@ const CleanWebpackPlugin = require('clean-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const path = require('path'); -const logger = require('./logger'); +const logger = require('../classes/logger'); -async function bundle(configuration) { +function resolve (folder) { + return path.resolve(__dirname, '../node_modules', folder) +} + +async function bundle (configuration) { const projectRootPath = configuration.rootPath; const config = { context: process.cwd(), entry: {}, - optimization:{ + optimization: { minimize: false }, target: 'web', @@ -29,7 +33,7 @@ async function bundle(configuration) { externals: { 'bookingbug-configurator-js': 'bbConfig', 'bookingbug-core-js': 'bbCore' - }, + }, plugins: [ new CleanWebpackPlugin(['build/**/*'], { root: projectRootPath, @@ -48,26 +52,26 @@ async function bundle(configuration) { test: /^(?!.*\.spec\.js$).*\.js$/, use: [ { - loader: path.resolve(__dirname, 'node_modules', 'ng-annotate-loader') + loader: resolve('ng-annotate-loader') }, { - loader: path.resolve(__dirname, 'node_modules', 'babel-loader'), + loader: resolve('babel-loader'), options: { presets: [ - [path.resolve(__dirname, 'node_modules', 'babel-preset-env'), { + [resolve('babel-preset-env'), { loose: true }] ], plugins: [ - path.resolve(__dirname, 'node_modules', 'babel-plugin-transform-object-rest-spread'), - path.resolve(__dirname, 'node_modules', 'babel-plugin-transform-decorators-legacy'), - path.resolve(__dirname, 'node_modules', 'babel-plugin-transform-async-to-generator'), - path.resolve(__dirname, 'node_modules', 'babel-plugin-transform-optional-catch-binding') + resolve('babel-plugin-transform-object-rest-spread'), + resolve('babel-plugin-transform-decorators-legacy'), + resolve('babel-plugin-transform-async-to-generator'), + resolve('babel-plugin-transform-optional-catch-binding') ] } }, { - loader: path.resolve(__dirname, 'node_modules', 'import-glob-loader') + loader: resolve('import-glob-loader') } ] }, @@ -77,28 +81,28 @@ async function bundle(configuration) { }, { test: /.*\.html$/, - use: path.resolve(__dirname, 'node_modules', `ng-cache-loader?prefix=${configuration.manifest.unique_name}&exportId`) + use: resolve(`ng-cache-loader?prefix=${configuration.manifest.unique_name}&exportId`) }, { test: /\.(jpe?g|png|gif|ico)$/i, - use: path.resolve(__dirname, 'node_modules', 'url-loader?name=images/[name].[ext]') + use: resolve('url-loader?name=images/[name].[ext]') }, { test: /.*fontawesome.*\.svg$/, - use: path.resolve(__dirname, 'node_modules', 'url-loader?name=fonts/[name].[ext]') + use: resolve('url-loader?name=fonts/[name].[ext]') }, { test: /\.font\.(?=svg$)/, - use: path.resolve(__dirname, 'node_modules', 'url-loader?name=fonts/[name].[ext]') + use: resolve('url-loader?name=fonts/[name].[ext]') }, { test: /\.svg$/, exclude: /\.font\.(?=svg$)/, - use: path.resolve(__dirname, 'node_modules', 'url-loader?name=images/[name].[ext]') + use: resolve('url-loader?name=images/[name].[ext]') }, { test: /\.(woff2?|ttf|otf|eot)$/, - use: path.resolve(__dirname, 'node_modules', 'url-loader?name=fonts/[name].[ext]') + use: resolve('url-loader?name=fonts/[name].[ext]') } ] } @@ -111,7 +115,7 @@ async function bundle(configuration) { } return new Promise((resolve, reject) => { - if (Object.keys(config.entry).length == 0) { + if (Object.keys(config.entry).length === 0) { logger.info('Skipping webpack bundle'); resolve(); } else { @@ -119,7 +123,7 @@ async function bundle(configuration) { webpack(config, (err, stats) => { if (err) reject(err); if (stats.compilation.errors && stats.compilation.errors.length > 0) { - for (i = 0; i < stats.compilation.errors.length; i++) { + for (let i = 0; i < stats.compilation.errors.length; i++) { logger.fatal(stats.compilation.errors[i]); } reject('Webpack error'); @@ -127,7 +131,7 @@ async function bundle(configuration) { reject(stats.toJson().errors); } else { if (stats.hasWarnings()) logger.warn(stats.toJson().warnings); - stats.toString().split("\n").forEach(logger.info); + logger.info(stats.toString()); logger.info('Completed webpack bundle'); resolve(); } diff --git a/configure-app.js b/services/configure-app.js similarity index 86% rename from configure-app.js rename to services/configure-app.js index a4b68f2..a86122f 100644 --- a/configure-app.js +++ b/services/configure-app.js @@ -1,20 +1,20 @@ const axios = require('axios'); -const logger = require('./logger'); +const logger = require('../classes/logger'); async function configureApp(configuration) { logger.info('Started config'); const data = JSON.stringify(configuration.appConfig); logger.info(`Config: '${data}'`); const protocol = configuration.port === 443 ? 'https' : 'http'; - const URL = `/api/v1/admin/${configuration.companyId}/apps/${configuration.name}/configure`; + const URL = `/api/v1/admin/${configuration.companyId}/apps/${configuration.appId}/configure`; await axios({ method: 'post', url: URL, baseURL: `${protocol}://${configuration.host}:${configuration.port}`, data: data, headers: { - 'App-Id': configuration.appId, + 'App-Id': configuration.clientId, 'Auth-Token': configuration.authToken, 'Content-Type': 'application/json', 'Content-Length': data.length diff --git a/create-entry.js b/services/create-entry.js similarity index 100% rename from create-entry.js rename to services/create-entry.js diff --git a/services/initialize.js b/services/initialize.js new file mode 100644 index 0000000..4fb2b64 --- /dev/null +++ b/services/initialize.js @@ -0,0 +1,47 @@ +const fs = require('fs-extra') +const path = require('path') +const inquirer = require('inquirer') + +const newOptions = require('../config/options/new-options.json') +const logger = require('../classes/logger') + +const questions = Object.entries(newOptions).reduce((list, pair) => { + const [name, question] = pair + list.push({ + type: 'input', + name: name, + message: question.describe, + }) + return list +}, []) + +const filterQuestions = (argv) => { + return questions.filter(question => !argv.hasOwnProperty(question.name)) +} + +const createFiles = (argv) => { + logger.info('Started new app') + fs.mkdirpSync(argv.dir) + const manifest = { + bbAppManifestVersion: '1.0', + // FIXME disambiguate as id and name + unique_name: argv.appId, + name: argv.unique_name, + author: argv.author, + version: '0.1', + panels: [], + objects: [], + scripts: [], + liquid: [], + } + fs.outputJsonSync(path.join(argv.dir, 'manifest.json'), manifest, {spaces: 2}) + logger.info('Completed new app') +} + +module.exports = (argv) => { + inquirer.prompt(filterQuestions(argv)).then(answers => { + argv = Object.assign(argv, answers) + createFiles(argv) + }) +} + diff --git a/install.js b/services/install.js similarity index 93% rename from install.js rename to services/install.js index 9e1b8e5..66a5d9e 100644 --- a/install.js +++ b/services/install.js @@ -3,13 +3,13 @@ const os = require('os'); const fs = require('fs'); const FormData = require('form-data'); -const Configuration = require('./configuration'); +const Configuration = require('../classes/Configuration'); const bundle = require('./bundle'); const zip = require('./zip'); const authenticate = require('./authenticate'); const configureApp = require('./configure-app'); const createEntry = require('./create-entry'); -const logger = require('./logger'); +const logger = require('../classes/logger'); async function submitForm(configuration) { return new Promise((resolve, reject) => { @@ -23,10 +23,10 @@ async function submitForm(configuration) { protocol: configuration.port === 443 ? 'https:' : 'http:', host: configuration.host, port: configuration.port || 443, - path: `/api/v1/admin/${configuration.companyId}/apps/${configuration.name}`, + path: `/api/v1/admin/${configuration.companyId}/apps/${configuration.appId}`, method: 'PUT', headers: { - 'App-Id': configuration.appId, + 'App-Id': configuration.clientId, 'Auth-Token': configuration.authToken } } diff --git a/tail.js b/services/tail.js similarity index 75% rename from tail.js rename to services/tail.js index d2326dd..78084a8 100644 --- a/tail.js +++ b/services/tail.js @@ -3,33 +3,33 @@ const http = require('http'); const yargs = require('yargs'); const axios = require('axios'); -const Configuration = require('./configuration'); +const Configuration = require('../classes/Configuration'); const authenticate = require('./authenticate'); -const logger = require('./logger'); +const logger = require('../classes/logger'); let shutdown = false; const delay = ms => new Promise(r => setTimeout(r, ms)); -async function getLogs(configuration, start_time = 0) { +async function getLogs (configuration, start_time = 0) { const protocol = configuration.port === 443 ? 'https' : 'http'; const end_time = new Date().getTime(); - const URL = `/api/v1/admin/${configuration.companyId}/apps/${configuration.name}/logs?start_time=${start_time}&end_time=${end_time}`; + const URL = `/api/v1/admin/${configuration.companyId}/apps/${configuration.appId}/logs?start_time=${start_time}&end_time=${end_time}`; try { const response = await axios({ method: 'get', url: URL, baseURL: `${protocol}://${configuration.host}:${configuration.port}`, headers: { - 'App-Id': configuration.appId, + 'App-Id': configuration.clientId, 'Auth-Token': configuration.authToken }, responseType: 'json' }); const json = response.data; json.forEach((logs) => { - joinedLines = logs.reduce((joined, line) => joined + line.message, ''); - if (joinedLines != '') console.log(joinedLines); + const joinedLines = logs.reduce((joined, line) => joined + line.message, ''); + if (joinedLines) console.log(joinedLines); }); await delay(2000); if (shutdown) { @@ -37,7 +37,7 @@ async function getLogs(configuration, start_time = 0) { } else { await getLogs(configuration, end_time); } - } catch(error) { + } catch (error) { if (error.response) { throw error.response.data; } else { @@ -46,11 +46,11 @@ async function getLogs(configuration, start_time = 0) { } } -function handleSignal() { +function handleSignal () { shutdown = true; } -module.exports = async function(argv) { +module.exports = async function (argv) { try { const projectRootPath = process.cwd(); const configuration = new Configuration(projectRootPath, argv); @@ -62,7 +62,7 @@ module.exports = async function(argv) { logger.info('Tailing logs'); console.log(''); await getLogs(configuration); - } catch(error) { + } catch (error) { logger.fatal(error); } } diff --git a/uninstall.js b/services/uninstall.js similarity index 88% rename from uninstall.js rename to services/uninstall.js index ddea03d..859c121 100644 --- a/uninstall.js +++ b/services/uninstall.js @@ -3,21 +3,21 @@ const http = require('http'); const yargs = require('yargs'); const axios = require('axios'); -const Configuration = require('./configuration'); +const Configuration = require('../classes/Configuration'); const authenticate = require('./authenticate'); -const logger = require('./logger'); +const logger = require('../classes/logger'); async function uninstallRequest(configuration) { logger.info('Started uninstall'); const protocol = configuration.port === 443 ? 'https' : 'http'; - const URL = `/api/v1/admin/${configuration.companyId}/apps/${configuration.name}`; + const URL = `/api/v1/admin/${configuration.companyId}/apps/${configuration.appId}`; try { const response = await axios({ method: 'delete', url: URL, baseURL: `${protocol}://${configuration.host}:${configuration.port}`, headers: { - 'App-Id': configuration.appId, + 'App-Id': configuration.clientId, 'Auth-Token': configuration.authToken } }); diff --git a/zip.js b/services/zip.js similarity index 92% rename from zip.js rename to services/zip.js index e8fcfe4..4f8ad50 100644 --- a/zip.js +++ b/services/zip.js @@ -4,7 +4,7 @@ const os = require('os'); const archiver = require('archiver'); const archive = archiver('zip'); -const logger = require('./logger'); +const logger = require('../classes/logger'); async function zip() { return new Promise((resolve, reject) => { @@ -13,6 +13,7 @@ async function zip() { output.on('close', function () { logger.info(archive.pointer() + ' total bytes'); logger.info('Completed zip'); + // logger.info(os.tmpdir()); resolve(); }); archive.on('warning', function (err) {