This Build Script is completely written in Literate CoffeeScript with ShellJS's Make System
Adds support for the make --version flag
target "--version", ->
# Print Version Information
echo "testly v#{pkginfo.version} make script (shelljs v#{pkginfo["dependencies"].shelljs.substr(1)})"
# Exit so no other targets are executed
exit 0
target "all", ->
# Run Tests
runTarget "test"
Runs the tests using testly
target "test", ->
# Create Arguments List
args = ["bin/testly", "--testdir=tests/", "--json=test-report.json"]
# Add --teamcity if TeamCity was detected
if teamcity
args.push "--teamcity"
# Execute Tests
node args.join " "
Target for Continuous Integration
target "ci", ->
# Run Tests
runTarget "test"
Updates Testly's Version using the 'semver' module. Also creates a git tag, pushes the tag, and pushes the update version commit.
target "update-version", ->
# Get Next Patch Version
next = semver.inc pkginfo.version, "patch"
# Update Version
echo "Updating Version to v#{next}"
pkginfo.version = next
# Write version to package.json
json(pkginfo).to "package.json"
# Create a Git Tag
git "tag v#{pkginfo.version}"
# Push the Created Tag
git "push --tags"
# Add Updated Files
git "add ."
# Commit Update
git "commit -m 'Update Version to v#{next}'"
# Push Commit
git "push origin master"
Publishes testly to NPM
target "publish", ->
# Run Tests to Ensure Release Works
runTarget "test"
# Update Version
runTarget "update-version"
npm "publish"
This of course is an extension of ShellJS's Make System. Here is the code for the invoker for the build script