Skip to content

Commit

Permalink
Remove es6 features
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Feb 15, 2015
1 parent fd3795f commit 2e78e2d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion node/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node

require('6to5/register')
// require('6to5/register')
require('./lib/index')
10 changes: 6 additions & 4 deletions node/lib/dokku-git-remote-parser/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
let spawn = require('child_process').spawn,
var spawn = require('child_process').spawn,
parse = require('./lib/dokku-git-remote-stream')

module.exports = (cb) => {
let gitRemote = spawn('git', ['remote', '-v'], { cwd: process.cwd() })
module.exports = function (cb) {
var gitRemote = spawn('git', ['remote', '-v'], { cwd: process.cwd() })

gitRemote.stdout
.pipe(parse)
.on('data', data => cb(data.host, data.appName))
.on('data', function (data) {
cb(data.host, data.appName)
})
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
let through2 = require('through2')
var through2 = require('through2')

module.exports = through2.obj(function(chunk, enc, cb) {
let remotes = chunk.toString().match(/dokku@([^:]*):(?:\/.*\/)?([^\s]*)/)
let host = remotes[1]
let appName = remotes[2]
var remotes = chunk.toString().match(/dokku@([^:]*):(?:\/.*\/)?([^\s]*)/)
var host = remotes[1]
var appName = remotes[2]

this.push({ host, appName })
this.push({ host: host, appName: appName })
cb()
})
18 changes: 11 additions & 7 deletions node/lib/dokku-ssh/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let spawn = require('child_process').spawn,
var spawn = require('child_process').spawn,
util = require('util')

const globalCommands = [
var globalCommands = [
'apps:create',
'apps:destroy',
'backup:export',
Expand All @@ -16,8 +16,8 @@ const globalCommands = [
'apps'
]

module.exports = (host, app, params) => {
let sshParams = ['-T', 'dokku@' + host]
module.exports = function (host, app, params) {
var sshParams = ['-T', 'dokku@' + host]

if (util.isArray(params)) {
sshParams.push(params.shift())
Expand All @@ -28,7 +28,11 @@ module.exports = (host, app, params) => {
sshParams = sshParams.concat(params)
}

let ssh = spawn('ssh', sshParams)
ssh.stdout.on('data', data => console.log(data.toString()))
ssh.stderr.on('data', data => console.log('err:', data.toString()))
var ssh = spawn('ssh', sshParams)
ssh.stdout.on('data', function (data) {
console.log(data.toString())
})
ssh.stderr.on('data', function (data) {
console.log('err:', data.toString())
})
}
6 changes: 3 additions & 3 deletions node/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let program = require('commander'),
var program = require('commander'),
ssh = require('./dokku-ssh'),
parser = require('./dokku-git-remote-parser'),
pjson = require('../../package.json')
Expand All @@ -7,8 +7,8 @@ program
.version(pjson.version)

program.command('* [params...]')
.action((params) => {
parser((host, app) => {
.action(function (params) {
parser(function (host, app) {
ssh(host, app, params)
})
})
Expand Down

0 comments on commit 2e78e2d

Please sign in to comment.