Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Kelty committed Jan 29, 2015
0 parents commit 69323c8
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"node": true,
"undef": true,
"unused": true,
"predef": ["-Promise"],
"latedef": "nofunc",
"globals": {
"module": false,
"require": false,
"define": false
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# shipit-ssh
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (shipit) {
require('./tasks/ssh')(shipit);
};
6 changes: 6 additions & 0 deletions lib/get-shipit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function getShipit(gruntOrShipit) {
if (gruntOrShipit.shipit)
return gruntOrShipit.shipit;

return gruntOrShipit;
};
20 changes: 20 additions & 0 deletions lib/register-task.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var Promise = require('bluebird');

module.exports = function registerTask(gruntOrShipit, name, task) {
if (gruntOrShipit.registerTask) {
if (Array.isArray(task))
return gruntOrShipit.registerTask(name, task);

return gruntOrShipit.registerTask(name, function () {
var done = this.async();
var promise = task();

if (promise)
promise.nodeify(done);
else
done();
});
}

return gruntOrShipit.blTask(name, task);
};
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "shipit-ssh",
"version": "1.0.0",
"description": "Open a remote shell with a Shipit command.",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "mocha --recursive"
},
"repository": {
"type": "git",
"url": "https://github.com/timkelty/shipit-ssh.git"
},
"keywords": [
"shipit",
"database",
"task"
],
"author": {
"name": "Tim Kelty",
"email": "[email protected]"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/timkelty/shipit-ssh/issues"
},
"homepage": "https://github.com/timkelty/shipit-ssh",
"devDependencies": {
"chai": "^1.10.0",
"mocha": "^2.1.0",
"rewire": "^2.1.4",
"shipit-cli": "^1.1.0",
"sinon": "^1.12.2",
"sinon-as-promised": "^2.0.3",
"sinon-chai": "^2.6.0"
},
"dependencies": {
"bluebird": "^2.9.1",
"chalk": "^0.5.1",
"lodash": "^2.4.1",
"path2": "^0.1.0",
"sprintf-js": "^1.0.2"
},
"readmeFile": "README.md"
}
3 changes: 3 additions & 0 deletions tasks/grunt-task.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (grunt) {
require('./ssh')(grunt);
};
11 changes: 11 additions & 0 deletions tasks/ssh/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* jshint unused:false */
var registerTask = require('../../lib/register-task');
var getShipit = require('../../lib/get-shipit');

module.exports = function (gruntOrShipit) {
registerTask(gruntOrShipit, 'ssh', task);

function task() {
var shipit = getShipit(gruntOrShipit);
}
};

0 comments on commit 69323c8

Please sign in to comment.