Skip to content

Commit 27f5a3e

Browse files
committed
feat(npm): init package.json and create bin bridge file to ember-cli
1 parent 9db2742 commit 27f5a3e

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

bin/wrenchjs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
// Provide a title to the process in `ps`
5+
process.title = 'wrenchjs';
6+
7+
var resolve = require('resolve');
8+
var exit = require('exit');
9+
10+
resolve('wrenchjs', {
11+
basedir: process.cwd()
12+
}, function(error, projectLocalCli) {
13+
var cli;
14+
if (error) {
15+
// If there is an error, resolve could not find the ember-cli
16+
// library from a package.json. Instead, include it from a relative
17+
// path to this script file (which is likely a globally installed
18+
// npm package). Most common cause for hitting this is `ember new`
19+
cli = require('ember-cli/lib/cli');
20+
} else {
21+
// No error implies a projectLocalCli, which will load whatever
22+
// version of ember-cli you have installed in a local package.json
23+
cli = require(projectLocalCli);
24+
}
25+
26+
cli({
27+
cliArgs: process.argv.slice(2),
28+
inputStream: process.stdin,
29+
outputStream: process.stdout
30+
}).then(function(result) {
31+
var exitCode = typeof result === 'object' ? result.exitCode : result;
32+
exit(exitCode);
33+
});
34+
});

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "wrenchjs",
3+
"version": "0.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"bin": {
7+
"wrenchjs": "./bin/wrenchjs"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/rodyhaddad/wrenchjs.git"
15+
},
16+
"author": "rodyhaddad <[email protected]> (http://rodyhaddad.com/)",
17+
"license": "MIT",
18+
"bugs": {
19+
"url": "https://github.com/rodyhaddad/wrenchjs/issues"
20+
},
21+
"homepage": "https://github.com/rodyhaddad/wrenchjs",
22+
"dependencies": {
23+
"ember-cli": "^0.2.1",
24+
"exit": "^0.1.2",
25+
"resolve": "^1.0.0"
26+
}
27+
}

0 commit comments

Comments
 (0)