Skip to content

Commit

Permalink
Tolerate local zip files that don't exist
Browse files Browse the repository at this point in the history
Fixes gh-1
  • Loading branch information
philwebb committed Mar 20, 2024
1 parent 7f3bf66 commit 9c13834
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ function register ({ config, downloadLog }) {
logger.trace(`Skipping local file URL ${url} due to missing worktree`)
continue
}
return ospath.join(worktree, ...url.split('/'))
const localFile = ospath.join(worktree, ...url.split('/'))
if(fs.existsSync(localFile)) return localFile

Check failure on line 199 in packages/antora-zip-contents-collector-extension/lib/index.js

View workflow job for this annotation

GitHub Actions / build

Expected space(s) after "if"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ describe('zip contents collector extension', () => {

it('should use local zip and collect files', async () => {
const extensionConfig = () => ({
locations: [{ url: 'build/${name}.zip' }, { url: 'build/${name}.zip' }],
locations: [{ url: 'build/missing/${name}.zip' }, { url: 'build/${name}.zip' }],
})
const componentConfig = { include: ['start-page'] }
await runScenario({
Expand Down

0 comments on commit 9c13834

Please sign in to comment.