Skip to content

Commit

Permalink
Update gruntfile to calculate dependencies when packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
rdsubhas committed Oct 23, 2015
1 parent 4fd1b80 commit ef8f610
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
22 changes: 14 additions & 8 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
'use strict'

module.exports = function (grunt) {
require('load-grunt-tasks')(grunt)
pkg = require('./package.json')
let pkg = require('./package.json')

let dep_files = Object.keys(pkg.dependencies).map(function (dep) {
return 'node_modules/' + dep + '/**/*'
})

grunt.initConfig({

Expand All @@ -9,15 +15,15 @@ module.exports = function (grunt) {
},

copy: {
all: {
sources: {
cwd: '.',
dest: 'build/app/',
src: ['images/**/*', 'lib/**/*', 'main.js', 'package.json']
},
dependencies: {
cwd: '.',
dest: 'build/app/',
src: [
'images/**/*', 'lib/**/*', 'main.js', 'package.json',
'node_modules/bluebird/**/*', 'node_modules/configstore/**/*',
'node_modules/fix-path/**/*', 'node_modules/lodash/**/*',
'node_modules/parse-columns/**/*', 'node_modules/dockerode/**/*'
]
src: dep_files
}
},

Expand Down
2 changes: 0 additions & 2 deletions lib/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const Lo = require('lodash')
const dialog = require('dialog')
const Docker = require('./docker')
const Menu = require('./menu')
const Promise = require('bluebird')
const nullFn = function () {}

const MACHINE_TEMPLATE = Lo.template('Driver: <%= DRIVER %>\nURL: <%= URL %>\nState: <%= STATE %>')
const CONTAINER_TEMPLATE = Lo.template('Image: <%= Image %>\nCommand: <%= Command %>\nStatus: <%= Status %>\nPorts: <%= Portmaps %>')
Expand Down
4 changes: 2 additions & 2 deletions lib/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ exports.connect = function (machine) {
let driver = json.Driver
let auth = json.HostOptions.AuthOptions
return new Docker({
host: json.Driver.IPAddress,
port: json.Driver.Port || 2376,
host: driver.IPAddress,
port: driver.Port || 2376,
ca: (auth.CaCertPath ? fs.readFileSync(auth.CaCertPath) : null),
cert: (auth.ClientCertPath ? fs.readFileSync(auth.ClientCertPath) : null),
key: (auth.ClientKeyPath ? fs.readFileSync(auth.ClientKeyPath) : null)
Expand Down
2 changes: 1 addition & 1 deletion lib/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ let buildContainersMenu = Promise.coroutine(function *(menu, machine) {
})

let buildContainerMenu = Promise.coroutine(function *(machine, container) {
container.bestName = Lo.min(container.Names, "length").replace(/^\//, '')
container.bestName = Lo.min(container.Names, 'length').replace(/^\//, '')
container.isRunning = !!container.Status.match(/^(running|up)/i)
return new MenuItem({
label: container.bestName,
Expand Down

0 comments on commit ef8f610

Please sign in to comment.