push2cloud-compiler
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,2 +5,3 @@ const debug = require('debug')('push2cloud-compiler:build-workspace'); | ||
const mkdirp = _.curry(require('mkdirp'), 2); | ||
const rimraf = require('rimraf'); | ||
const join = require('path').join; | ||
@@ -19,3 +20,4 @@ | ||
const buildWorkspace = ( | ||
plugins | ||
options | ||
, plugins | ||
, deploymentConfigPath | ||
@@ -25,2 +27,10 @@ , workspacePath | ||
) => { | ||
if (!done) { | ||
done = workspacePath; | ||
workspacePath = deploymentConfigPath; | ||
deploymentConfigPath = plugins; | ||
plugins = options; | ||
options = {}; | ||
} | ||
options = options || {}; | ||
debug('Creating the workspace...'); | ||
@@ -38,4 +48,11 @@ deploymentConfigPath = deploymentConfigPath || join(process.cwd(), 'deploymentConfig.json'); | ||
var clear = (cb) => cb(); | ||
if (options.clearWorkspace) { | ||
clear = (cb) => rimraf(workspacePath, cb); | ||
} | ||
async.series( | ||
[ mkdirp(workspacePath) | ||
[ clear | ||
, mkdirp(workspacePath) | ||
, (cb) => async.each( | ||
@@ -42,0 +59,0 @@ config.apps |
@@ -78,2 +78,5 @@ const _ = require('lodash'); | ||
a.instances = convertSize(a.instances); | ||
if (appManifest.deployment.path || appManifest.deployment.appBits) { | ||
a.appBits = appManifest.deployment.path || appManifest.deployment.appBits | ||
} | ||
@@ -80,0 +83,0 @@ return a; |
{ | ||
"name": "push2cloud-compiler", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "compiler for push2cloud manifests", | ||
@@ -22,3 +22,3 @@ "scripts": { | ||
"devDependencies": { | ||
"eslint": "2.8.0" | ||
"eslint": "2.11.1" | ||
}, | ||
@@ -32,4 +32,4 @@ "dependencies": { | ||
"git-archive": "0.1.4", | ||
"load-json-file": "1.1.0", | ||
"lodash": "4.11.1", | ||
"load-json-file": "2.0.0", | ||
"lodash": "4.13.1", | ||
"mkdirp": "0.5.1", | ||
@@ -40,4 +40,4 @@ "request": "2.72.0", | ||
"underscore.string": "3.3.4", | ||
"write-json-file": "1.2.0" | ||
"write-json-file": "2.0.0" | ||
} | ||
} |
@@ -5,2 +5,3 @@ const _ = require('lodash'); | ||
const join = require('path').join; | ||
const rimraf = require('rimraf'); | ||
@@ -25,3 +26,4 @@ const createTmpDir = require('./lib/createTmpDir'); | ||
const prepare = ( | ||
plugins | ||
options | ||
, plugins | ||
, deploymentManifestPath | ||
@@ -31,2 +33,5 @@ , tmpDir | ||
) => { | ||
options = options || {}; | ||
const getFile = _.find(plugins, (p) => p.getFile).getFile; | ||
@@ -42,2 +47,9 @@ const getFileAs = _.find(plugins, (p) => p.getFileAs).getFileAs; | ||
var clear = (cb) => cb(); | ||
if (options.clearWorkspace) { | ||
clear = (cb) => rimraf(tmpDir, cb); | ||
} | ||
const afterPlugins = _.map(_.filter(plugins, (p) => p.afterPrepare), | ||
@@ -55,3 +67,4 @@ (p) => p.afterPrepare.bind(p, tmpDir)); | ||
async.waterfall([ | ||
createTmpDir(tmpDir) | ||
clear | ||
, createTmpDir(tmpDir) | ||
, (next) => { | ||
@@ -58,0 +71,0 @@ cp(deploymentManifestPath, tmpDeploymentManifest)((err) => { |
# push2cloud-compiler | ||
[![npm](https://img.shields.io/npm/v/push2cloud-compiler.svg)](https://npmjs.org/package/push2cloud-compiler) | ||
[![Dependency Status](https://david-dm.org/push2cloud/compiler.svg)](https://david-dm.org/push2cloud/compiler) | ||
[![devDependency Status](https://david-dm.org/push2cloud/compiler/dev-status.svg)](https://david-dm.org/push2cloud/compiler#info=devDependencies) | ||
This repository is part of the push2cloud project. For contribution guidelines, issues, and general documentation, visit the main [push2cloud project page](https://github.com/push2cloud/push2cloud). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37271
33
632
8
+ Addedload-json-file@2.0.0(transitive)
+ Addedlodash@4.13.1(transitive)
+ Addedstrip-bom@3.0.0(transitive)
+ Addedwrite-json-file@2.0.0(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedlodash@4.11.1(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedwrite-json-file@1.2.0(transitive)
Updatedload-json-file@2.0.0
Updatedlodash@4.13.1
Updatedwrite-json-file@2.0.0