Skip to content

Commit

Permalink
Record version in pileup.version
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Nov 23, 2015
1 parent 959dc16 commit f0912fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#!/bin/bash

# Check that all .js files have an @flow comment.
noflow=$(git ls-files | egrep '^(src|test).*\.js$' | grep -v '/data-canvas.js' | xargs grep --files-without-match '@flow')
if [ -n "$noflow" ]; then
echo 'These files are missing @flow annotations:'
echo "$noflow"
exit 1
fi

# Check that the versions in package.json and pileup.js match.
package_version=$(grep '"version": ' package.json | sed 's/.*: "//; s/".*//')
code_version=$(grep 'version: ' src/main/pileup.js | sed "s/.*: '//; s/'.*//")
if [[ $package_version != $code_version ]]; then
echo "pileup.js version mismatch!"
echo " package.json: $package_version"
echo " src/main/pileup.js: $code_version"
exit 1
fi

# Run the usual linter
./node_modules/.bin/jsxhint --es6module --harmony 'src/main/**/*.js' 'src/test/**/*.js'
3 changes: 2 additions & 1 deletion src/main/pileup.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ var pileup = {
scale: makeVizObject(ScaleTrack),
variants: makeVizObject(VariantTrack),
pileup: makeVizObject(PileupTrack)
}
},
version: '0.6.1'
};

module.exports = pileup;
Expand Down

0 comments on commit f0912fb

Please sign in to comment.