Skip to content

Commit

Permalink
fix: wrong url link, remove debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
fish.yu committed Apr 18, 2024
1 parent 0e3bee7 commit d61b572
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Downloader {
// }

let mdBody = formatRaw(body);
console.log('md file content:', mdBody);
// console.log('md file content:', mdBody);

// 判断是否有图片
const reg = /!\[(.*?)\]\((.*?)\)/g;
Expand Down Expand Up @@ -165,12 +165,11 @@ class Downloader {
const imageUrl = `_images/${imageName}`;
// 上传到github
const result = await this.gh.writeFile(imageUrl, content, { encode: false });
console.log('uploadImageFromUrl result:', result);
if (!result.status) {
console.error('upload image failed:', url, content);
throw new Error('upload image failed:', result);
}
return `https://github.com/${imageUrl}`;
return result.data.content.url;
}

/**
Expand Down

0 comments on commit d61b572

Please sign in to comment.