Skip to content

Commit

Permalink
Add checksum for babel config files (#647)
Browse files Browse the repository at this point in the history
* Copy babel config during testing

* Add checksum for babel-config files
  • Loading branch information
tejasbubane authored and SleeplessByte committed Mar 25, 2019
1 parent d131c88 commit d209ecf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ TSTFILE := "$(subst _,-,$(ASSIGNMENT)).spec.$(FILEEXT)"
SOURCE_PKG_MD5 ?= "`./bin/md5-hash ./package.json`"
PKG_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name package.json)

# babel.config.js MD5 hash
SOURCE_BABEL_MD5 ?= "`./bin/md5-hash ./babel.config.js`"
BABEL_CONFIG_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name babel.config.js)

copy-assignment:
@cp package.json exercises/$(ASSIGNMENT)
@cp babel.config.js exercises/$(ASSIGNMENT)
@mkdir -p $(OUTDIR)
@cp exercises/grains/lib/big-integer.$(FILEEXT) $(OUTDIR)
@cp exercises/$(ASSIGNMENT)/$(TSTFILE) $(OUTDIR)
Expand All @@ -36,6 +41,9 @@ test-travis:
@for pkg in $(PKG_FILES); do \
! ./bin/md5-hash $$pkg | grep -qv $(SOURCE_PKG_MD5) || { echo "$$pkg does not match main package.json. Please run 'make test' locally and commit the results."; exit 1; }; \
done
@for bconfig in $(BABEL_CONFIG_FILES); do \
! ./bin/md5-hash $$bconfig | grep -qv $(SOURCE_BABEL_MD5) || { echo "$$bconfig does not match main babel.config.js. Please run 'make test' locally and commit the results."; exit 1; }; \
done
$(MAKE) -s test

test:
Expand Down

0 comments on commit d209ecf

Please sign in to comment.