initial commit, build is not working

This commit is contained in:
Konstantin Vulsonov
2018-09-18 23:16:10 +03:00
commit 024d0e3125
12 changed files with 1395 additions and 0 deletions

37
src/bin.ts Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env node
import { exit } from 'process';
import { SvgIconset } from './app';
const argv = require('yargs').argv;
const exampleString = 'Example: svg-iconset --source=assets/images/icons --name=icons';
const {
source,
name,
attrs,
removeViewBox
} = argv;
if (source === undefined) {
console.error('Source dir is not set');
console.error(exampleString);
exit();
}
if (name === undefined) {
console.error('Result filename is not set');
console.error(exampleString);
exit();
}
new SvgIconset({
source,
result: name,
optimize: {
attrs,
removeViewBox
}
}).createSet();