Skip to content

Commit

Permalink
fixes for #255
Browse files Browse the repository at this point in the history
  • Loading branch information
ritwickdey committed Feb 12, 2019
1 parent c68d219 commit 110dee6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 11 additions & 3 deletions src/Helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ export const SUPPRORTED_EXT: string[] = [
'.html', '.htm', '.svg'
];

export const isRelativePath = (pathUrl: string) => {
if (pathUrl.startsWith('*')) return false;

return !path.isAbsolute(pathUrl);
}


export class Helper {


Expand All @@ -23,7 +30,7 @@ export class Helper {
rootPath = testPath;
}
else {
rootPath = workSpacePath;
rootPath = workSpacePath;
}

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

const ignoreFiles = [];
ignorePathGlob.forEach(ignoredPath => {
if (!ignoredPath.startsWith('/') || !ignoredPath.startsWith('\\'))
ignoreFiles.push(workspacePath + path.sep + ignoredPath);
if (isRelativePath(ignoredPath))
ignoreFiles.push(path.join(workspacePath, ignoredPath));
else ignoreFiles.push(ignoredPath);
});

const proxy = Helper.getProxySetup();
Expand Down
7 changes: 3 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ export function activate(context: ExtensionContext) {

checkNewAnnouncement(context.globalState);
context.subscriptions.push(commands
.registerCommand('extension.liveServer.goOnline', (fileUri) => {
workspace.saveAll().then(() => {
appModel.Golive(fileUri ? fileUri.fsPath : null);
});
.registerCommand('extension.liveServer.goOnline', async (fileUri) => {
await workspace.saveAll();
appModel.Golive(fileUri ? fileUri.fsPath : null);
})
);

Expand Down

0 comments on commit 110dee6

Please sign in to comment.