Skip to content

Commit

Permalink
fix import path on Windows machines
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed May 3, 2022
1 parent 5d98a78 commit 3fdb73d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/src/update-icon-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
below.
*/
import {getObjectTypedKeys, kebabCaseToCamelCase} from 'augment-vir/dist';
import {readDirRecursive} from 'augment-vir/dist/node-only';
import {readDirRecursive, toPosixPath} from 'augment-vir/dist/node-only';
import {existsSync} from 'fs';
import {readFile, writeFile} from 'fs/promises';
import {basename, dirname, join, relative} from 'path';
Expand All @@ -29,7 +29,7 @@ function generateIconNameFromFilePath(filePath: string): string {

function generateTsImport(iconFilePath: string, iconName: string): string {
const relativePath = relative(dirname(iconIndexPath), iconFilePath).replace(/\.ts$/, '');
return `import {${iconName}} from './${relativePath}';`;
return `import {${iconName}} from './${toPosixPath(relativePath)}';`;
}

function generateTsCode(iconPaths: string[]): string {
Expand Down

0 comments on commit 3fdb73d

Please sign in to comment.