Skip to content

Commit

Permalink
fix: Fix website version option issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Feb 10, 2022
1 parent fe2573d commit 4cf70ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ export type SvgToFontOptions = {
}

export default async (options: SvgToFontOptions = {}) => {
const confPath = path.join(process.cwd(), '.svgtofontrc');
if (fs.pathExistsSync(confPath)) {
const conf = await fs.readJson(confPath);
options = { ...options, ...conf };
}

const pkgPath = path.join(process.cwd(), 'package.json');
if (fs.pathExistsSync(pkgPath)) {
const pkg = require(pkgPath);
Expand All @@ -166,12 +172,6 @@ export default async (options: SvgToFontOptions = {}) => {
}
}

const confPath = path.join(process.cwd(), '.svgtofontrc');
if (fs.pathExistsSync(confPath)) {
const conf = await fs.readJson(confPath);
options = { ...options, ...conf };
}

options.dist = options.dist || path.join(process.cwd(), 'fonts');
options.src = options.src || path.join(process.cwd(), 'svg');
options.startUnicode = options.startUnicode || 0xea01;
Expand Down

0 comments on commit 4cf70ee

Please sign in to comment.