Skip to content

Commit

Permalink
feat: Enhance --sources/--output argv. #168
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 15, 2022
1 parent e4d57e3 commit d190c02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const argv = yargs
.epilog('copyright 2019')
.argv as ArgvResult;

const sourcesPath = path.join(process.cwd(), argv.sources);
const outputPath = path.join(process.cwd(), argv.output);
const sourcesPath = path.resolve(process.cwd(), argv.sources);
const outputPath = path.resolve(process.cwd(), argv.output);

if (!FS.pathExistsSync(sourcesPath)) {
log.error('The directory does not exist!', sourcesPath);
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export default async (options: SvgToFontOptions = {}) => {
if (options.log === undefined) options.log = true;
log.disabled = !options.log;
if (options.logger && typeof options.logger === 'function') log.logger = options.logger;
options.dist = options.dist || path.join(process.cwd(), 'fonts');
options.src = options.src || path.join(process.cwd(), 'svg');
options.dist = options.dist || path.resolve(process.cwd(), 'fonts');
options.src = options.src || path.resolve(process.cwd(), 'svg');
options.startUnicode = options.startUnicode || 0xea01;
options.svg2ttf = options.svg2ttf || {};
options.emptyDist = options.emptyDist;
Expand Down

0 comments on commit d190c02

Please sign in to comment.