Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunxing Dai committed Sep 2, 2016
0 parents commit 8c7ee50
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var spawn = require('child_process').spawn;

var input = process.argv.slice(2);
var bin = require('./');

spawn(bin, input, {stdio: 'inherit'})
.on('exit', process.exit);
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var bin = require('./lib');

module.exports = bin.path();
21 changes: 21 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var path = require('path');
var BinWrapper = require('bin-wrapper');

var VERSION = '0.0.0';
var URL = 'https://github.com/npm-opam/utop-bin/releases/download/';
var BASE = URL + VERSION + '/';

module.exports = new BinWrapper()
.src(BASE + 'utop-osx-v' + VERSION + '.zip', 'darwin')
.src(BASE + 'utop-linux64-v' + VERSION + '.zip', 'linux', 'x64')
.dest(path.join(__dirname, '../vendor'))
.use('utop');
21 changes: 21 additions & 0 deletions lib/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var log = require('logalot');
var bin = require('./');

bin.run(['--version'], function (err) {
if (err) {
log.error(err.message);
log.error('utop binary test failed');
return;
}

log.success('utop binary test passed successfully');
});
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "utop-installer-bin",
"version": "0.0.0",
"description": "bin wrapper for utop",
"license": "MIT",
"bin": {
"utop": "cli.js"
},
"scripts": {
"postinstall": "node lib/install.js"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js",
"cli.js",
"lib"
],
"dependencies": {
"bin-wrapper": "^3.0.2",
"logalot": "^2.0.0"
},
"devDependencies": {
"bin-check": "^3.0.0"
}
}
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# utop-bin

> Binary wrapper for utop
OS X, Linux (64-bit) binaries are currently [provided]

0 comments on commit 8c7ee50

Please sign in to comment.