1
1
mirror of https://github.com/primer/css.git synced 2024-12-03 03:33:40 +03:00
css/tools/primer-module-build/index.js

20 lines
439 B
JavaScript
Raw Normal View History

const build = require('./lib/build')
function InputException(message) {
this.message = message
this.name = "InputException"
}
module.exports = ({input, flags}) => {
if (!input || input.length === 0) {
throw new InputException("You must supply a file to build")
}
const [file] = input
if (!file.match(/\.scss$/)) {
throw new InputException("We are only able to handle .scss files")
}
return build(file, flags)
}