mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-12-19 12:15:08 +08:00
working
This commit is contained in:
6
react-native-pushy-cli/.babelrc
Normal file
6
react-native-pushy-cli/.babelrc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-es2015-modules-commonjs",
|
||||
"transform-strict-mode"
|
||||
]
|
||||
}
|
||||
7
react-native-pushy-cli/.npmignore
Normal file
7
react-native-pushy-cli/.npmignore
Normal file
@@ -0,0 +1,7 @@
|
||||
/.idea
|
||||
/src
|
||||
/.babelrc
|
||||
/.npmignore
|
||||
/.eslintrc
|
||||
/.nvmrc
|
||||
/.travis.yml
|
||||
@@ -4,10 +4,11 @@
|
||||
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"pushy": "cli.js"
|
||||
"pushy": "lib/cli.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"prepublish": "node_modules/.bin/babel src --out-dir lib"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,7 +26,9 @@
|
||||
"url": "https://github.com/reactnativecn/react-native-pushy/issues"
|
||||
},
|
||||
"homepage": "https://github.com/reactnativecn/react-native-pushy/tree/master/react-native-pushy-cli",
|
||||
"dependencies": {
|
||||
"babel-register": "^6.5.2"
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.5.1",
|
||||
"babel-plugin-transform-es2015-modules-commonjs": "^6.5.2",
|
||||
"babel-plugin-transform-strict-mode": "^6.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
* Created by tdzl2003 on 2/13/16.
|
||||
*/
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs-promise';
|
||||
|
||||
|
||||
var CLI_MODULE_PATH = function() {
|
||||
const CLI_MODULE_PATH = function() {
|
||||
return path.resolve(
|
||||
process.cwd(),
|
||||
'node_modules',
|
||||
@@ -16,7 +15,7 @@ var CLI_MODULE_PATH = function() {
|
||||
);
|
||||
};
|
||||
|
||||
var PACKAGE_JSON_PATH = function() {
|
||||
const PACKAGE_JSON_PATH = function() {
|
||||
return path.resolve(
|
||||
process.cwd(),
|
||||
'node_modules',
|
||||
@@ -27,18 +26,8 @@ var PACKAGE_JSON_PATH = function() {
|
||||
|
||||
checkForVersionCommand();
|
||||
|
||||
require('babel-register')({
|
||||
'plugins': [
|
||||
'transform-async-to-generator',
|
||||
'transform-strict-mode',
|
||||
'transform-object-rest-spread',
|
||||
'transform-es2015-parameters',
|
||||
'transform-es2015-destructuring',
|
||||
],
|
||||
});
|
||||
|
||||
var cli;
|
||||
var cliPath = CLI_MODULE_PATH();
|
||||
let cli;
|
||||
const cliPath = CLI_MODULE_PATH();
|
||||
if (fs.existsSync(cliPath)) {
|
||||
cli = require(cliPath);
|
||||
}
|
||||
@@ -53,7 +42,7 @@ if (cli) {
|
||||
|
||||
function checkForVersionCommand() {
|
||||
if (process.argv.indexOf('-v') >= 0 || process.argv[2] === 'version') {
|
||||
console.log('react-native-pushy-cli: ' + require('./package.json').version);
|
||||
console.log('react-native-pushy-cli: ' + require('../package.json').version);
|
||||
try {
|
||||
console.log('react-native-pushy: ' + require(PACKAGE_JSON_PATH()).version);
|
||||
} catch (e) {
|
||||
Reference in New Issue
Block a user