Skip to content

Commit 110dee6

Browse files
committed
fixes for #255
1 parent c68d219 commit 110dee6

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/Helper.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ export const SUPPRORTED_EXT: string[] = [
88
'.html', '.htm', '.svg'
99
];
1010

11+
export const isRelativePath = (pathUrl: string) => {
12+
if (pathUrl.startsWith('*')) return false;
13+
14+
return !path.isAbsolute(pathUrl);
15+
}
16+
17+
1118
export class Helper {
1219

1320

@@ -23,7 +30,7 @@ export class Helper {
2330
rootPath = testPath;
2431
}
2532
else {
26-
rootPath = workSpacePath;
33+
rootPath = workSpacePath;
2734
}
2835

2936
if (!rootPath.endsWith(path.sep))
@@ -80,8 +87,9 @@ export class Helper {
8087

8188
const ignoreFiles = [];
8289
ignorePathGlob.forEach(ignoredPath => {
83-
if (!ignoredPath.startsWith('/') || !ignoredPath.startsWith('\\'))
84-
ignoreFiles.push(workspacePath + path.sep + ignoredPath);
90+
if (isRelativePath(ignoredPath))
91+
ignoreFiles.push(path.join(workspacePath, ignoredPath));
92+
else ignoreFiles.push(ignoredPath);
8593
});
8694

8795
const proxy = Helper.getProxySetup();

src/extension.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ export function activate(context: ExtensionContext) {
99

1010
checkNewAnnouncement(context.globalState);
1111
context.subscriptions.push(commands
12-
.registerCommand('extension.liveServer.goOnline', (fileUri) => {
13-
workspace.saveAll().then(() => {
14-
appModel.Golive(fileUri ? fileUri.fsPath : null);
15-
});
12+
.registerCommand('extension.liveServer.goOnline', async (fileUri) => {
13+
await workspace.saveAll();
14+
appModel.Golive(fileUri ? fileUri.fsPath : null);
1615
})
1716
);
1817

0 commit comments

Comments
 (0)