Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
Use ci-job-number
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jul 4, 2017
1 parent 2c0f429 commit 85e0ae5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
13 changes: 2 additions & 11 deletions bin.js
@@ -1,18 +1,9 @@
#!/usr/bin/env node

'use strict'

function isFirstJob () {
if (process.env.TRAVIS) {
return process.env.TRAVIS_JOB_NUMBER.split('.')[1] === '1'
} else if (process.env.APPVEYOR) {
return process.env.APPVEYOR_JOB_NUMBER === '1'
} else {
return true
}
}
const ciJobNumber = require('ci-job-number')

if (isFirstJob()) {
if (ciJobNumber() === 1) {
require('yaspeller/lib/cli')
} else {
console.warn('To speed up CI spelling check runs only in first job')
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -16,6 +16,7 @@
"repository": "ai/yaspeller-ci",
"bin": "./bin.js",
"dependencies": {
"ci-job-number": "^0.1.0",
"yaspeller": "^3.2.0"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Expand Up @@ -164,6 +164,10 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3, chalk@~1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

ci-job-number@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/ci-job-number/-/ci-job-number-0.1.0.tgz#271b545126e2aefd459ff20f808bd6181733a2d0"

circular-json@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d"
Expand Down

0 comments on commit 85e0ae5

Please sign in to comment.