Create `generated` directory if necessary (fixes #2807)

pull/2809/head
Alex Dima 3 years ago
parent 86cff74999
commit 6b2f528d9f
No known key found for this signature in database
GPG Key ID: 39563C1504FDD0C9

@ -50,10 +50,10 @@ function generateTestSamplesTask() {
const prefix = const prefix =
'//This is a generated file via `npm run simpleserver`\ndefine([], function() { return'; '//This is a generated file via `npm run simpleserver`\ndefine([], function() { return';
const suffix = '; });'; const suffix = '; });';
fs.writeFileSync(
path.join(REPO_ROOT, 'test/manual/generated/all-samples.js'), const destination = path.join(REPO_ROOT, 'test/manual/generated/all-samples.js');
prefix + JSON.stringify(samples, null, '\t') + suffix ensureDir(path.dirname(destination));
); fs.writeFileSync(destination, prefix + JSON.stringify(samples, null, '\t') + suffix);
/** @type {{ chapter: string; name: string; id: string; path: string; }[]} */ /** @type {{ chapter: string; name: string; id: string; path: string; }[]} */
const PLAY_SAMPLES = require(path.join(WEBSITE_GENERATED_PATH, 'all.js')).PLAY_SAMPLES; const PLAY_SAMPLES = require(path.join(WEBSITE_GENERATED_PATH, 'all.js')).PLAY_SAMPLES;

Loading…
Cancel
Save