Skip to content

Commit

Permalink
fix(git): Try to fix a few glitches
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Jan 19, 2024
1 parent deb66b9 commit 2ca38d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/adapters/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export default class GitAdapter extends CachingAdapter {
return false
}

if (!fileContents.includes('<?xml version="1.0" encoding="UTF-8"?>') && !fileContents.includes('<!DOCTYPE NETSCAPE-Bookmark-file-1>')) {
if (!fileContents || (fileContents.includes('<?xml version="1.0" encoding="UTF-8"?>') && !fileContents.includes('<!DOCTYPE NETSCAPE-Bookmark-file-1>'))) {
throw new FileUnreadableError()
}

Expand Down Expand Up @@ -313,6 +313,10 @@ export default class GitAdapter extends CachingAdapter {
const hash = await Crypto.sha256(JSON.stringify(this.server)) + Date.now()
this.dir = '/' + hash + '/'

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const fs = new FS('floccus', {wipe: true})

Logger.log('(git) init')
await git.init({ fs, dir: this.dir, defaultBranch: this.server.branch })
await git.addRemote({
Expand Down

0 comments on commit 2ca38d0

Please sign in to comment.