#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build:
	mkdir -p node_modules/@types/estree
	cp debian/estree.d.ts node_modules/@types/estree/index.d.ts
	tsc --module commonjs src/index.ts && mv src/index.js .
	sed -i index.js -e "s/exports\[\"default\"\]/module.exports/g"

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
override_dh_auto_test:
	mocha test
else
override_dh_auto_test:
	@echo '**********************************************************'
	@echo ' Skip test suite'
	@echo '**********************************************************'
endif
