mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
Bring back missing android command
Summary: Fixes #9312 (Sorry for inconvenience, could've been removed by mistake!) Bonus: projectName can be configured rather than always defaulting to package.json name, not sure if helpful, but just added it since we have a `default` function that makes sense in this case. Closes https://github.com/facebook/react-native/pull/9525 Differential Revision: D3753610 Pulled By: bestander fbshipit-source-id: 641872855b9865502f4055910262686edc4b504e
This commit is contained in:
committed by
Facebook Github Bot 2
parent
a6868161cb
commit
993cfa1826
32
local-cli/android/android.js
Normal file
32
local-cli/android/android.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* 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 generate = require('../generate/generate');
|
||||
var fs = require('fs');
|
||||
|
||||
function android(argv, config, args) {
|
||||
return generate([
|
||||
'--platform', 'android',
|
||||
'--project-path', process.cwd(),
|
||||
'--project-name', args.projectName,
|
||||
], config);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: 'android',
|
||||
description: 'creates an empty android project',
|
||||
func: android,
|
||||
options: [{
|
||||
command: '--project-name [name]',
|
||||
default: () => JSON.parse(
|
||||
fs.readFileSync('package.json', 'utf8')
|
||||
).name,
|
||||
}],
|
||||
};
|
||||
Reference in New Issue
Block a user