-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5494c3
commit 6223a9d
Showing
10 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env node | ||
|
||
var autostart = require('../'), | ||
optimist = require('optimist'), | ||
prompt = require('prompt'); | ||
|
||
// | ||
// Override params | ||
// | ||
prompt.override = optimist.argv; | ||
|
||
// | ||
// Welcome | ||
// | ||
console.log('Welcome to' + 'Autostart'.grey); | ||
console.log('It worked if it ends with ' + 'Autostart '.grey + 'ok'.green); | ||
|
||
// | ||
// Start prompt | ||
// | ||
prompt.start(); | ||
|
||
prompt.get(['os', 'command'], function (err, params) { | ||
var os = params.os, | ||
command = params.command; | ||
|
||
if (err) { | ||
console.log(err); | ||
return console.log('autostart: ' + 'not ok'.red); | ||
} | ||
|
||
console.log('Creating autostart script for ' + os.magenta); | ||
autostart.create(os, command, function () { | ||
console.log('Autostart '.grey + 'ok'.green); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./lib/autostart'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var handlebars = require('handlebars'), | ||
fs = require('fs'); | ||
|
||
var autostart = exports; | ||
|
||
// | ||
// _loadTemplate: Loads os template | ||
// | ||
function _loadTemplate(os, cb) { | ||
cb(null); | ||
} | ||
|
||
autostart._loadTemplate = _loadTemplate; | ||
|
||
autostart.create = function create(os, command, cb) { | ||
// | ||
// Load Template | ||
// | ||
_loadTemplate(os, function (err, template) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
|
||
cb(); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "autostart", | ||
"version": "0.0.1", | ||
"description": "Autostart a node process", | ||
"main": "index.js", | ||
"bin": "./bin/autostart", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha --reporter spec" | ||
}, | ||
"repository": "", | ||
"author": "Julian Duque", | ||
"license": "MIT", | ||
"dependencies": { | ||
"handlebars": "~1.0.10", | ||
"optimist": "~0.4.0", | ||
"prompt": "~0.2.9", | ||
"mkdirp": "~0.3.5" | ||
}, | ||
"readme": "README.md", | ||
"devDependencies": { | ||
"mocha": "~1.9.0", | ||
"chai": "~1.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var autostart = require('../'), | ||
should = require('chai').should(), | ||
assert = require('chai').assert, | ||
fs = require('fs'); | ||
|
||
describe('Darwin Platform', function () { | ||
describe('autostart', function () { | ||
|
||
describe('#_loadTemplate', function () { | ||
it('should exist', function () { | ||
should.exist(autostart._loadTemplate); | ||
}); | ||
|
||
it('should load a template'); | ||
}); | ||
|
||
describe('#create', function () { | ||
it('should exist', function () { | ||
should.exist(autostart.create); | ||
}); | ||
|
||
it('should create an autostart install script'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var autostart = require('../'), | ||
should = require('chai').should(), | ||
assert = require('chai').assert, | ||
fs = require('fs'); | ||
|
||
describe('Linux Platform', function () { | ||
describe('autostart', function () { | ||
|
||
describe('#_loadTemplate', function () { | ||
it('should exist', function () { | ||
should.exist(autostart._loadTemplate); | ||
}); | ||
|
||
it('should load a template'); | ||
}); | ||
|
||
describe('#create', function () { | ||
it('should exist', function () { | ||
should.exist(autostart.create); | ||
}); | ||
|
||
it('should create an autostart install script'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var autostart = require('../'), | ||
should = require('chai').should(), | ||
assert = require('chai').assert, | ||
fs = require('fs'); | ||
|
||
describe('SunOS Platform', function () { | ||
describe('autostart', function () { | ||
|
||
describe('#_loadTemplate', function () { | ||
it('should exist', function () { | ||
should.exist(autostart._loadTemplate); | ||
}); | ||
|
||
it('should load a template'); | ||
}); | ||
|
||
describe('#create', function () { | ||
it('should exist', function () { | ||
should.exist(autostart.create); | ||
}); | ||
|
||
it('should create an autostart install script'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var autostart = require('../'), | ||
should = require('chai').should(), | ||
assert = require('chai').assert, | ||
fs = require('fs'); | ||
|
||
describe('Win32 Platform', function () { | ||
describe('autostart', function () { | ||
|
||
describe('#_loadTemplate', function () { | ||
it('should exist', function () { | ||
should.exist(autostart._loadTemplate); | ||
}); | ||
|
||
it('should load a template'); | ||
}); | ||
|
||
describe('#create', function () { | ||
it('should exist', function () { | ||
should.exist(autostart.create); | ||
}); | ||
|
||
it('should create an autostart install script'); | ||
}); | ||
}); | ||
}); |