fix(org): Switch to direct grep rather than find
When we don't care about the language, use grep directly rather than find first in prebuild script. This is to sidestep an issue where the vercel build fails because the find+grep combo fails (even though it does find the results).
This commit is contained in:
parent
079a739c1a
commit
21ee1c4a36
1 changed files with 8 additions and 10 deletions
|
@ -39,17 +39,15 @@ const loadFolderFrontmatter = async (key, site, folder, transform = false, lang
|
||||||
* But the biggest task is combing through all the org documentation and for this
|
* But the biggest task is combing through all the org documentation and for this
|
||||||
* it's much faster to first run find to limit the number of files to open
|
* it's much faster to first run find to limit the number of files to open
|
||||||
*/
|
*/
|
||||||
const cmd = `find . -type f -name "${lang ? lang : '*'}.md" -exec grep "^${key}:" -ism 1 {} +`
|
//const cmd = `find . -type f -name "${lang ? lang : '*'}.md" -exec grep "^${key}:" -ism 1 {} +`
|
||||||
let grep
|
const cmd = lang
|
||||||
try {
|
? `find . -type f -name "${lang ? lang : '*'}.md" -exec grep "^${key}:" -ism 1 {} +`
|
||||||
grep = exec(cmd, { cwd, maxBuffer: 2048 * 1024 }, (error, stdout, stderr) => {
|
: `grep -R "^${key}:" -ism 1 .`
|
||||||
|
const grep = exec(cmd, { cwd, maxBuffer: 2048 * 1024 }, (error, stdout, stderr) => {
|
||||||
if (error) console.error('Exec error:', { cwd, cmd, error, stderr })
|
if (error) console.error('Exec error:', { cwd, cmd, error, stderr })
|
||||||
|
|
||||||
return stdout
|
return stdout
|
||||||
})
|
})
|
||||||
} catch (err) {
|
|
||||||
console.log('caught', err)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stdout is buffered, so we need to gather all of it
|
* Stdout is buffered, so we need to gather all of it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue