compass-version-callback
Callback-style version of compass-version
const compassVersionCallback = require('compass-version-callback');
compassVersionCallback((err, version) => {
if (err) {
throw err;
}
version; //=> '1.0.3'
});
Installation
npm install compass-version-callback
API
const compassVersionCallback = require('compass-version-callback');
compassVersionCallback([options,] callback)
options: Object
(directly passed to child_process#spawn
)
callback: Function
It detects the installed Compass version in compass version
command.
options
In addition to child_process#spawn
, you can set bundleExec
option:
options.bundleExec
Type: Boolean
Default: false
Detect the version in bundle exec compass version
, instead of compass version
.
callback(error, version)
error: Error
when it fails to run compass
(or bundle exec compass
) command, otherwise null
version: String
(looks like '1.0.3'
)
const compassVersionCallback = require('compass-version-callback');
compassVersionCallback({bundleExec: true}, (err, version) => {
if (err) {
throw err;
}
version; //=> '1.0.3'
});
Testing
Requires Git, Node v4+ and Docker machine.
-
Clone this repository and change CWD to the cloned
compass-version-callback
directory. - Run
npm install
. - Create and run a container with no additional settings.
- Run
npm test
.
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.