Skip to content

Commit

Permalink
refactor use path.sep
Browse files Browse the repository at this point in the history
  • Loading branch information
Yale-Yu-art committed Oct 23, 2023
1 parent 1f1accf commit 3887f0b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/qwik/src/cli/utils/templates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'node:fs';
import { join } from 'node:path';
import { join, sep } from 'node:path';
import type { TemplateSet } from '../types';
import { getFilesDeep } from './utils';

Expand Down Expand Up @@ -58,10 +58,7 @@ export async function readTemplates(rootDir: string) {
}

function parseTemplatePath(path: string, type: string) {
let parts = path.split(`/${type}/`);
if (parts.length == 1) {
parts = path.split(`\\${type}\\`);
}
const parts = path.split(sep + type + sep);

return {
absolute: path,
Expand Down

0 comments on commit 3887f0b

Please sign in to comment.