Skip to content

Commit

Permalink
feat: Add CLI more options. #48
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 28, 2020
1 parent be0604d commit f5f6100
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ export type SvgToFontOptions = {
}

export default async (options: SvgToFontOptions = {}) => {
const pkgPath = path.join(process.cwd(), 'package.json');
if (fs.pathExistsSync(pkgPath)) {
const pkg = require(pkgPath);
if (pkg.svgtofont) {
options = { ...options, ...pkg.svgtofont }
}
}

options.dist = options.dist || path.join(process.cwd(), 'fonts');
options.src = options.src || path.join(process.cwd(), 'svg');
options.unicodeStart = options.unicodeStart || 10000;
Expand Down

0 comments on commit f5f6100

Please sign in to comment.