2018-04-26 23:44:58 +03:00
|
|
|
const build = require('./lib/build')
|
|
|
|
|
|
|
|
function InputException(message) {
|
|
|
|
this.message = message
|
|
|
|
this.name = "InputException"
|
|
|
|
}
|
|
|
|
|
2018-04-28 01:27:51 +03:00
|
|
|
module.exports = ({input, flags}) => {
|
|
|
|
if (!input || input.length === 0) {
|
2018-04-26 23:44:58 +03:00
|
|
|
throw new InputException("You must supply a file to build")
|
|
|
|
}
|
|
|
|
|
2018-04-28 01:27:51 +03:00
|
|
|
const [file] = input
|
|
|
|
if (!file.match(/\.scss$/)) {
|
2018-04-26 23:44:58 +03:00
|
|
|
throw new InputException("We are only able to handle .scss files")
|
|
|
|
}
|
|
|
|
|
2018-05-01 00:09:21 +03:00
|
|
|
return build(file, flags)
|
2018-04-26 23:44:58 +03:00
|
|
|
}
|