Skip to content

Commit b2ce844

Browse files
authored
Merge pull request #18 from Pineappletooth/bugfix/fix-windows-files-path
fix duplicate drive path in windows
2 parents 8922595 + 53c0b9e commit b2ce844

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {DocumentUri} from 'vscode-languageserver-textdocument';
33
import path from 'path';
44
import {EOL} from 'os';
55
import fs from 'fs';
6+
import url from 'url';
67
import _camelCase from 'lodash.camelcase';
78

89
import postcss from 'postcss';
@@ -11,7 +12,8 @@ import type {Node, Parser, ProcessOptions, Comment} from 'postcss';
1112
import {resolveAliasedImport} from './utils/resolveAliasedImport';
1213

1314
export function getCurrentDirFromUri(uri: DocumentUri) {
14-
return path.dirname(uri).replace(/^file:\/\//, '');
15+
const filePath = url.fileURLToPath(uri);
16+
return path.dirname(filePath);
1517
}
1618

1719
export type CamelCaseValues = false | true | 'dashes';

0 commit comments

Comments
 (0)