diff --git a/bin/renderlocal b/bin/renderlocal index 9904233..59ddaea 100755 --- a/bin/renderlocal +++ b/bin/renderlocal @@ -3,8 +3,8 @@ const nopt = require('nopt'); const path = require('path'); -const IOUtils = require('../test/lib/IOUtils'); -const LocalRenderer = require('../test/lib/LocalRenderer'); +const IOUtils = require('../lib/IOUtils'); +const LocalRenderer = require('../lib/LocalRenderer'); const args = nopt( { @@ -16,12 +16,12 @@ const args = nopt( ); if (args.mtp === undefined) { - console.error("exactly one --mtp is required!"); + console.error('exactly one --mtp is required!'); process.exit(1); } if (args.env === undefined || args.env.length < 1) { - console.error("at least one --env is required!"); + console.error('at least one --env is required!'); process.exit(1); } @@ -31,8 +31,8 @@ async function renderLocal() { if (args.out === undefined) { await IOUtils.printYaml(data); } else { - await IOUtils.writeYamlFile(data, args.out) + await IOUtils.writeYamlFile(data, args.out); } -}; +} renderLocal(); diff --git a/test/lib/IOUtils.js b/lib/IOUtils.js similarity index 100% rename from test/lib/IOUtils.js rename to lib/IOUtils.js diff --git a/test/lib/LocalMustacheTemplateController.js b/lib/LocalMustacheTemplateController.js similarity index 86% rename from test/lib/LocalMustacheTemplateController.js rename to lib/LocalMustacheTemplateController.js index 119086a..6755df4 100644 --- a/test/lib/LocalMustacheTemplateController.js +++ b/lib/LocalMustacheTemplateController.js @@ -1,5 +1,5 @@ const { MockKubeResourceMeta } = require('@razee/razeedeploy-core'); -const MustacheTemplateController = require('../../src/MustacheTemplateController'); +const MustacheTemplateController = require('../src/MustacheTemplateController'); module.exports = class LocalMustacheTemplateController extends MustacheTemplateController { constructor(params) { diff --git a/test/lib/LocalRenderer.js b/lib/LocalRenderer.js similarity index 100% rename from test/lib/LocalRenderer.js rename to lib/LocalRenderer.js diff --git a/package.json b/package.json index f33437b..38b1394 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Razee: component to use the Mustache template processor on kubernetes resource configurations.", "main": "./src/index.js", "bin": { - "mustachetemplate": "./bin/mustachetemplate", - "renderlocal": "./bin/renderlocal" + "mustachetemplate": "./bin/mustachetemplate", + "renderlocal": "./bin/renderlocal" }, "keywords": [ "kubernetes", diff --git a/src/index.js b/src/index.js index 8f39443..4e13267 100644 --- a/src/index.js +++ b/src/index.js @@ -18,7 +18,6 @@ const { EventHandler, KubeClass } = require('@razee/kubernetes-util'); const ControllerString = 'MustacheTemplate'; const Controller = require(`./${ControllerString}Controller`); -const LocalRenderer = require(`${__dirname}/../test/lib/LocalRenderer`); const log = require('./logger').createLogger(ControllerString); async function createNewEventHandler(kc) { @@ -72,6 +71,6 @@ async function run() { module.exports = { run, - LocalRenderer, + LocalRenderer: require('../lib/LocalRenderer'), MustacheTemplateController: Controller }; diff --git a/test/mustache-template-tests.js b/test/mustache-template-tests.js index 9f96405..0027832 100644 --- a/test/mustache-template-tests.js +++ b/test/mustache-template-tests.js @@ -1,5 +1,5 @@ var assert = require('chai').assert; -var Controller = require('../test/lib/LocalMustacheTemplateController'); +var Controller = require('../lib/LocalMustacheTemplateController'); describe('#processTemplates', async function () { const eventData = {