Skip to content

Conversation

sanscontext
Copy link
Contributor

Proposed changes

Trying to prevent the isCatalogItemHidden function from barfing if there's no file. This seems to be a race condition (?!) when checking to see if the file exists? My changes in this PR prevent the "create file" part from running, but at least unblocks make catalog - I might be using the wrong (sync vs async?) file system method here.

Related issues (optional)

Closes #568
(hopefully)

XavierAgostini
XavierAgostini approved these changes Mar 4, 2020
Copy link
Contributor

@XavierAgostini XavierAgostini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const isCatalogItemHidden = (itemURL) => {
try {
const catalogPath = path.resolve('src', itemURL, 'index.md')
if (fs.existsSync(catalogPath)) {
const f = fm(fs.readFileSync(catalogPath, 'utf8'));
if (f.attributes.hidden) return true
}
return false
} catch (e) {
console.log(error)
return false
}
}

@sanscontext
Copy link
Contributor Author

Xav fixed this, and I forgot I'd taken a crack at it. Closing out!

@sanscontext sanscontext deleted the catalog-troubleshooting branch April 16, 2020 16:29
bot-docsteam added a commit that referenced this pull request Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make catalog sometimes fails when new destination appears without a file

2 participants