From 32aeeea3135fbb504b1481c0e7cbad1ddf1ae057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Bigio?= Date: Thu, 22 Oct 2015 10:11:28 -0700 Subject: [PATCH] Fix cli entry points Reviewed By: frantic Differential Revision: D2565954 fb-gh-sync-id: 6fde9e1dbefd71944e8f857e9a40619bf599ef75 --- local-cli/cli.js | 5 +++++ package.json | 2 +- packager/launchPackager.command | 1 + packager/package.json | 2 +- packager/packager.sh | 11 +++++++++++ private-cli/src/util/Config.js | 1 + 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 packager/packager.sh diff --git a/local-cli/cli.js b/local-cli/cli.js index 44b8cf0d3ad..e0bb17270d7 100644 --- a/local-cli/cli.js +++ b/local-cli/cli.js @@ -8,6 +8,11 @@ */ 'use strict'; +require('../packager/babelRegisterOnly')([ + /private-cli\/src/, + /local-cli/ +]); + var bundle = require('../private-cli/src/bundle/bundle'); var childProcess = require('child_process'); var Config = require('../private-cli/src/util/Config'); diff --git a/package.json b/package.json index 531c3d5df31..abf8fd6143a 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "scripts": { "test": "NODE_ENV=test jest", "lint": "eslint Examples/ Libraries/", - "start": "react-native start || true" + "start": "./packager/packager.sh || true" }, "dependencies": { "absolute-path": "^0.0.0", diff --git a/packager/launchPackager.command b/packager/launchPackager.command index 0537f7c84d8..ec0f417a5db 100755 --- a/packager/launchPackager.command +++ b/packager/launchPackager.command @@ -13,5 +13,6 @@ clear THIS_DIR=$(dirname "$0") $THIS_DIR/packager.sh + echo "Process terminated. Press to close the window" read diff --git a/packager/package.json b/packager/package.json index e3d6b22d935..c5d4832e65e 100644 --- a/packager/package.json +++ b/packager/package.json @@ -24,7 +24,7 @@ "scripts": { "test": "jest", "lint": "node linter.js Examples/", - "start": "react-native start" + "start": "./packager.sh" }, "dependencies": { "wordwrap": "^1.0.0" diff --git a/packager/packager.sh b/packager/packager.sh new file mode 100755 index 00000000000..2c6a0eba669 --- /dev/null +++ b/packager/packager.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# 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. + +THIS_DIR=$(dirname "$0") +node "$THIS_DIR/../local-cli/cli.js" start "$@" diff --git a/private-cli/src/util/Config.js b/private-cli/src/util/Config.js index 39f1e65c196..5ac0c72214a 100644 --- a/private-cli/src/util/Config.js +++ b/private-cli/src/util/Config.js @@ -43,6 +43,7 @@ const Config = { : {}; cachedConfig = Object.assign({}, defaultConfig, config); + process.chdir(pwd); return cachedConfig; } };