Commit b3be1b38 by Nick Schonning

Build: Move to ShellJS

parent 606ca863
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
}, },
"scripts": { "scripts": {
"install": "node build.js", "install": "node build.js",
"test": "mocha test", "test": "node scripts/test",
"coverage": "bash scripts/coverage.sh", "coverage": "node scripts/coverage",
"pretest": "jshint .", "pretest": "node scripts/lint",
"prepublish": "bash scripts/prepublish.sh" "prepublish": "node scripts/prepublish"
}, },
"bin": { "bin": {
"node-sass": "bin/node-sass" "node-sass": "bin/node-sass"
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
"nan": "~0.8.0", "nan": "~0.8.0",
"node-watch": "~0.3.4", "node-watch": "~0.3.4",
"optimist": "~0.6.1", "optimist": "~0.6.1",
"shelljs": "~0.2.6",
"sinon": "~1.9.1" "sinon": "~1.9.1"
}, },
"devDependencies": { "devDependencies": {
......
#!/usr/bin/env node
/*jshint shelljs:true */
"use strict";
require("shelljs/make");
var path = require("path");
var JSCOVERAGE_BIN = ["node_modules", ".bin", "jscoverage"].join(path.sep);
var COVERALLS_BIN = ["node_modules", ".bin", "coveralls"].join(path.sep);
var MOCHA_BIN = ["node_modules", ".bin", "mocha"].join(path.sep);
echo("Creating coverage files");
exec(JSCOVERAGE_BIN + " sass.js sass-coverage.js");
exec(JSCOVERAGE_BIN + " lib lib-coverage");
echo("Piping mocha to coveralls");
env["NODESASS_COVERAGE"] = 1;
exec(MOCHA_BIN + " test -R mocha-lcov-reporter | " + COVERALLS_BIN, {async: false}, function(code, output) {
console.log('Exit code:', code);
console.log('Program output:', output);
echo("Cleanup coverage files");
rm("sass-coverage.js");
rm("-R", "lib-coverage");
});
#!/bin/bash
./node_modules/.bin/jscoverage sass.js sass-coverage.js
./node_modules/.bin/jscoverage lib lib-coverage
NODESASS_COVERAGE=1 ./node_modules/.bin/mocha test -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
\ No newline at end of file
#!/usr/bin/env node
/*jshint shelljs:true */
"use strict";
require("shelljs/make");
exec("jshint .");
#!/usr/bin/env node
/*jshint shelljs:true */
"use strict";
require('shelljs/make');
if (env["$CI"]) {
echo("Skipping prepublish on CI builds");
exit(0);
}
// Look for a local clone of
var NODE_SASS_BINARIES_DIR = "../node-sass-binaries";
if (!test("-e", NODE_SASS_BINARIES_DIR)) {
if (!which("git")) {
echo("Sorry, this script requires git");
exit(1);
}
// Clone the binary repo to the expected location
var NODE_SASS_DIR = pwd();
cd("..");
exec("git clone https://github.com/andrew/node-sass-binaries.git")
cd(NODE_SASS_DIR);
}
echo("Copying binaries to bin");
cp("-Rf", NODE_SASS_BINARIES_DIR + "/*", "bin");
rm(["bin/LICENSE", "bin/README.md"]);
#!/bin/bash
DIRECTORY="../node-sass-binaries"
if [ "$CI" == "true" ]; then
echo "Skipping prepublish on CI builds";
elif [ -d "$DIRECTORY" ]; then
echo "Copying binaries to bin"
cp -R $DIRECTORY/*-v8-* bin/
else
echo "Skipping bin copy. Please clone https://github.com/andrew/node-sass-binaries for prebuilt binaries";
fi
\ No newline at end of file
#!/usr/bin/env node
/*jshint shelljs:true */
"use strict";
require("shelljs/make");
exec("mocha test");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment