Skip to content

Commit

Permalink
🐛 fix TobiasTao#44
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasTao committed Dec 4, 2021
1 parent ea406c3 commit 6ab91de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mdEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export class MarkdownEditorProvider implements vscode.CustomTextEditorProvider {

let picgo: VSPicgo;

const mdFilepath = document.uri.fsPath;

let linkBase = webviewPanel.webview
.asWebviewUri(document.uri)
.toString(true)
Expand Down Expand Up @@ -175,6 +173,9 @@ export class MarkdownEditorProvider implements vscode.CustomTextEditorProvider {
case 'img':
let imgName = e.imgName;
const imgData = Buffer.from(e.file, 'binary');
if (!fs.existsSync(imgStoreDir)) {
fs.mkdirSync(imgStoreDir, { recursive: true });
}
let imgStorePath = path.join(imgStoreDir, imgName);
console.log('imgStorePath: ' + imgStorePath);
fs.writeFile(imgStorePath, imgData, (err) => {
Expand Down

0 comments on commit 6ab91de

Please sign in to comment.