Skip to content

Commit

Permalink
Merge pull request #22 from expobrain/hook
Browse files Browse the repository at this point in the history
Various small changes
  • Loading branch information
expobrain committed Mar 4, 2019
2 parents d07de3a + 6eb1cd6 commit 99807a0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
12 changes: 11 additions & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#!/bin/bash -eu

changes=$(git diff)

if [ ! -z "$changes" ] ; then
git stash save --keep-index 1> /dev/null
fi

# Rebuild bins if necessary
bin_files=$(git diff --cached --name-only --diff-filter=ACM "*ast_to_js.*" | tr '\n' ' ')
Expand All @@ -24,4 +30,8 @@ if [ -n "$py_files" ] ; then
echo "$py_files" | xargs git add
fi

if [ ! -z "$changes" ] ; then
git stash pop 1> /dev/null
fi

exit 0
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Trivial/internal changes

- [#21](https://github.com/expobrain/json-schema-codegen/pull/21) Fixed anchors in README
- [#22](https://github.com/expobrain/json-schema-codegen/pull/22) Various internal improvements and fixes

## v0.3.0

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"webpack-cli": "^3.0.7"
},
"scripts": {
"build:test:js": "babel-node scripts/build_js_ast.js",
"build:test:js": "babel-node scripts/build_js_ast.js && npm run code:format tests/**/*.json",
"code:format": "prettier --write",
"build:bin": "webpack --config config/ast_to_js.webpack.config.js && chmod +x bin/ast_to_js"
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ line-length = 99
py36 = true
exclude = '''
/(
\.git
\.git|node_modules
)/
'''
2 changes: 1 addition & 1 deletion scripts/build_js_ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ const buildAst = (astDir: string) => {
});
};

["javascript", "flow"].map(v => path.join(BASE_AST_DIR, v)).forEach(buildAst);
["javascript_flow", "flow"].map(v => path.join(BASE_AST_DIR, v)).forEach(buildAst);

0 comments on commit 99807a0

Please sign in to comment.