Skip to content

Commit

Permalink
Merge pull request #27 from FDiskas/patch-1
Browse files Browse the repository at this point in the history
Update tasks.js
  • Loading branch information
pmadruga authored Nov 25, 2019
2 parents 6c0f790 + d50880a commit c4df2d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ This is a combination of the commands suggested in the React Native documentatio
| Yarn cache | `yarn cache clean` | Yes | Yes | true | --keep-node-modules |
| Yarn packages | `yarn install` | No | Yes | true | --keep-node-modules |
| NPM cache | `npm cache verify` | Yes | Yes | true | --keep-node-modules |
| NPM Install | `npm ci` | Yes | Yes | true | --keep-node-modules |
| iOS build folder | `rm -rf ios/build` | Yes | Yes | false | --remove-iOS-build |
| iOS pods folder | `rm -rf ios/pods` | Yes | Yes | false | --remove-iOS-pods |
| Android build folder | `rm -rf android/build` | Yes | Yes | false | --remove-android-build |
Expand Down
1 change: 1 addition & 0 deletions source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ options
executeTask(tasks.wipeNodeModules)
.then(() => executeTask(tasks.yarnCacheClean))
.then(() => executeTask(tasks.npmCacheVerify))
.then(() => executeTask(tasks.npmInstall))
.then(() => executeTask(tasks.yarnInstall))
.then(() => options.getUpdatePods() && executeTask(tasks.updatePods))
.catch(() => {
Expand Down
12 changes: 9 additions & 3 deletions source/internals/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,23 @@ const tasks = {
},
yarnCacheClean: {
name: 'yarn cache clean (if yarn is installed)',
command: 'yarn cache clean || true',
command: 'test -f yarn.lock && yarn cache clean || true',
args: []
},
yarnInstall: {
name: 'yarn install (if yarn is installed)',
command: 'yarn install || true',
command: 'test -f yarn.lock && yarn install || true',
args: []
},
npmCacheVerify: {
name: 'npm cache verify',
command: 'npm',
args: ['cache', 'verify']
},
npmInstall: {
name: 'npm ci',
command: 'test -f package-lock.json && npm ci || true',
args: []
}
};

Expand All @@ -74,7 +79,8 @@ const autoTasks = [
tasks.wipeTempCaches,
tasks.wipeNodeModules,
tasks.yarnCacheClean,
tasks.npmCacheVerify
tasks.npmCacheVerify,
tasks.npmInstall
];

module.exports = {
Expand Down

0 comments on commit c4df2d3

Please sign in to comment.