Skip to content

Commit 580ec4f

Browse files
committed
added the logic for generating reference docs from local custom build of p5.sound.js
1 parent 69fc695 commit 580ec4f

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/scripts/parsers/reference.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,21 @@ export const parseLibraryReference =
5555
if (useExternalP5Sound) {
5656
console.log('Cloning separate p5.sound repo');
5757

58-
// Clone p5.sound.js
59-
await cloneLibraryRepo(
60-
localSoundPath,
61-
'https://github.com/processing/p5.sound.js.git',
62-
'main'
63-
);
58+
// Clone or copy p5.sound.js
59+
if (process.env.LOCAL_P5_SOUND_PATH) {
60+
console.log(`Copying local p5.sound.js from ${process.env.LOCAL_P5_SOUND_PATH}`);
61+
await fs.cp(process.env.LOCAL_P5_SOUND_PATH, localSoundPath, {
62+
recursive: true,
63+
// Ignore node_modules and .git to speed up the copy
64+
filter: (src) => !src.includes('node_modules') && !src.includes('.git')
65+
});
66+
} else {
67+
await cloneLibraryRepo(
68+
localSoundPath,
69+
'https://github.com/processing/p5.sound.js.git',
70+
'main'
71+
);
72+
}
6473
await saveYuidocOutput('p5.sound.js', 'data-sound');
6574
const soundData = await getYuidocOutput('data-sound');
6675
if (!soundData) throw new Error('Error generating p5.sound reference data!');

0 commit comments

Comments
 (0)