Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
18 lines
708 B
Plaintext
18 lines
708 B
Plaintext
/* eslint-disable no-console */ import minimist from 'minimist';
|
|
import { pathToFileURL } from 'node:url';
|
|
import { findConfig, loadEnv } from 'payload/node';
|
|
import { generateSchema } from './generateSchema.js';
|
|
export const bin = async ()=>{
|
|
loadEnv();
|
|
const configPath = findConfig();
|
|
const config = await (await import(pathToFileURL(configPath).toString())).default;
|
|
const args = minimist(process.argv.slice(2));
|
|
const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase();
|
|
if (script === 'generate:schema') {
|
|
return generateSchema(config);
|
|
}
|
|
console.log(`Unknown script: "${script}".`);
|
|
process.exit(1);
|
|
};
|
|
|
|
//# sourceMappingURL=index.js.map |