Skip to content

Commit

Permalink
Fix missleading error-messages
Browse files Browse the repository at this point in the history
This commit finally fixes #7!
Additionally opening files now also is supported for macOS and Linux-OSes.
  • Loading branch information
Manuel Thalmann authored and Manuel Thalmann committed May 22, 2017
1 parent c7ca0eb commit 7cd4e20
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## 0.0.8
- Reworked the PhantomJS-process [#1](https://github.com/manuth/MarkdownConverter/issues/1)
- Adjusted the way to handle templates [#6](https://github.com/manuth/MarkdownConverter/issues/6)
- Provided the functionallity to choose whether to embed or link certain css-files [#4](https://github.com/manuth/MarkdownConverter/issues/4)
- Patched missleading error-messages [#7](https://github.com/manuth/MarkdownConverter/issues/7)

<!--- References -->
[MarkdownItCheckbox]: https://www.npmjs.com/package/markdown-it-checkbox
26 changes: 25 additions & 1 deletion src/Program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,31 @@ export class Program
{
if (label == localize(1 /* "OpenFileLabel" */, null))
{
ChildProcess.exec(Format('"{0}"', destination));
try
{
/**
* Opening a file...
* ...the windows-way...
*/
ChildProcess.execSync(Format('"{0}"', destination));
}
catch (e)
{
try
{
/**
* ...the linux-way...
*/
ChildProcess.execSync(Format('bash -c \'xdg-open "{0}"\'', destination))
}
catch (e)
{
/**
* ...and the macOS-way
*/
ChildProcess.execSync(Format('bash -c \'open "{0}"\'', destination))
}
}
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function activate(context: vscode.ExtensionContext)
}
catch (e)
{
vscode.window.showErrorMessage(localize(6 /* PhantomRebuildException */, null));
vscode.window.showErrorMessage(localize(7 /* PhantomRebuildException */, null));
phantomJSBuilt = false;
}
}
Expand All @@ -60,7 +60,7 @@ export function activate(context: vscode.ExtensionContext)
}
else
{
vscode.window.showWarningMessage(localize(6 /* PhantomRebuildException */, null));
vscode.window.showWarningMessage(localize(7 /* PhantomRebuildException */, null));
}
}
else
Expand Down

0 comments on commit 7cd4e20

Please sign in to comment.