Skip to content

Commit

Permalink
fix: allow for adding files to the root of a github repo
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Jul 14, 2023
1 parent 36c8e5a commit b98001b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/clients/github-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GitHubClient {
if (imageDataUrl) {
const filename = `${nanoid(10)}.${imageDataUrl.ext}`
files.push({
path: `${this.options.image_path}/${filename}`,
path: `${this.options.image_path ? `${this.options.image_path}/` : ''}${filename}`,
content: imageDataUrl.url
})

Expand Down Expand Up @@ -111,7 +111,7 @@ class GitHubClient {

//add markdown file to files
files.push({
path: `${this.options.article_path}/${slug}.md`,
path: `${this.options.article_path ? `${this.options.article_path}/` : ''}${slug}.md`,
content: this.toBase64(markdown)
})

Expand Down

0 comments on commit b98001b

Please sign in to comment.