Skip to content

Commit

Permalink
add bin
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed May 27, 2016
1 parent bd6af17 commit dcba199
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
56 changes: 56 additions & 0 deletions bin/macaca-adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env node

'use strict';

const co = require('co');
const fs = require('fs');
const path = require('path');
const EOL = require('os').EOL;
const chalk = require('chalk');
const update = require('npm-update');
const program = require('commander');
const spawn = require('child_process').spawn;

const ADB = require('../');
const pkg = require('../package');
const logger = require('../lib/logger');

program
.usage('[options] [arguments]')
.option('-v, --versions', 'show version and exit')
.option('--verbose', 'show more debugging information')
.helpInformation = function() {
return [
'',
' \u001b[37m' + pkg.description + '\u001b[0m',
'',
' Usage:',
' ' + this._name + ' or detect-port ' + this.usage(),
'',
' Options:',
'' + this.optionHelp().replace(/^/gm, ' '),
'',
' Further help:',
'',
' \u001b[4m' + pkg.homepage + '\u001b[0m',
'',
''
].join('\n');
};

program.parse(process.argv);

if (program.versions) {
console.log('%s version: %s', pkg.name, pkg.version);
process.exit(0);
}

const args = program.args;
const action = args[0];

switch (action) {
case 'install':
const apkPath = path.resolve(args[1]);
console.log(apkPath);
break;
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"name": "macaca-adb",
"version": "1.0.9",
"version": "1.0.10",
"description": "macaca adb",
"keywords": [
"adb"
],
"bin": {
"macaca-adb": "./bin/macaca-adb"
},
"main": "./lib/macaca-adb",
"repository": {
"type": "git",
"url": "git://github.com/macacajs/macaca-adb.git"
},
"dependencies": {
"chalk": "^1.1.3",
"commander": "^2.9.0",
"macaca-utils": "^0.1.6",
"npm-update": "^1.0.2",
"xlogger": "~1.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit dcba199

Please sign in to comment.