Skip to content

Commit

Permalink
Fixed saving not possible
Browse files Browse the repository at this point in the history
  • Loading branch information
StopMotionCuber committed Jun 14, 2020
1 parent d0d5ae3 commit 16b1653
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ exports.activate = function activate(context) {
else if (doc.isUntitled)
errMsg('Saving html failed: current untitled markdown document needs to be saved once first!');
else {
fs.writeFileSync(outputLocationOf(uri.fsPath), asHTML(doc), 'utf8');
fs.writeFileSync(outputLocationOf(uri), asHTML(doc), 'utf8');
infoMsg(`Html saved to ${outputLocationOf(uri.fsPath)} !`);
}
} catch (err) {
errMsg('Saving html failed: ' + err.message);
}
},
outputLocationOf = (fsPath) => {
const root = vscode.workspace.getWorkspaceFolder(fsPath),
parsed = path.parse(fsPath),
outputLocationOf = (uri) => {
const root = vscode.workspace.getWorkspaceFolder(uri),
parsed = path.parse(uri.fsPath),
savePath = cfg('savePath') // use https://code.visualstudio.com/updates/v1_31#_global-storage-path instead in future !
.replace('${file.name}', parsed.name)
.replace('${file.ext}', parsed.ext),
Expand Down

0 comments on commit 16b1653

Please sign in to comment.