Skip to content

Commit 1774c67

Browse files
committed
refactor: add setup npm script
1 parent e4aaba9 commit 1774c67

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

CONTRIBUTING.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,9 @@ Before you submit a Pull Request, consider the following guidelines.
4242
```bash
4343
git clone [email protected]:NativeScript/nativescript-cli.git
4444
```
45-
* Install the node dependencies.
45+
* Run the setup script. This will initialize the git submodule, install the node dependencies and build with grunt.
4646
```bash
47-
npm install --ignore-scripts
48-
```
49-
* Initialize the submodule.
50-
```bash
51-
git submodule init
52-
```
53-
* Fetch data from the submodule.
54-
```bash
55-
git submodule update
47+
npm run setup
5648
```
5749
* Make your changes in a new `git` branch. We use the <a href="http://nvie.com/posts/a-successful-git-branching-model/">Gitflow branching model</a> so you will have to branch from our master branch.
5850
```bash

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,7 @@ How to Build
431431
```
432432
git clone https://github.com/NativeScript/nativescript-cli
433433
cd nativescript-cli
434-
git submodule update --init
435-
npm install --ignore-scripts
436-
./node_modules/.bin/grunt
434+
npm run setup
437435
```
438436

439437
To use the locally built CLI instead `tns` you can call `PATH_TO_CLI_FOLDER/bin/tns`. For example:

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"main": "./lib/nativescript-cli-lib.js",
1212
"scripts": {
13+
"setup": "git submodule update --init && npm i --ignore-scripts && ./node_modules/.bin/grunt",
1314
"test": "node test-scripts/istanbul.js",
1415
"postinstall": "node postinstall.js",
1516
"preuninstall": "node preuninstall.js",

0 commit comments

Comments
 (0)