π₯ Make videos programmatically with React
also strip control characters from CLI directory argument
Boseok Kang72e42ce3690b
diff --git a/packages/create-video/src/resolve-project-root.ts b/packages/create-video/src/resolve-project-root.tsindex 7e6e6368b4..2dcfd5c477 100644--- a/packages/create-video/src/resolve-project-root.ts+++ b/packages/create-video/src/resolve-project-root.ts@@ -56,9 +56,12 @@ export const resolveProjectRoot = async (options?: {let projectName = '';let directlyCreateInCurrentDir = false;+ // eslint-disable-next-line no-control-regex+ const stripControlChars = (s: string) => s.replace(/[\x00-\x1f\x7f]/g, '');+// If a directory argument was provided, use it directlyif (options?.directoryArgument) {- projectName = options.directoryArgument;+ projectName = stripControlChars(options.directoryArgument).trim();} else {// Print selected template info before prompting for directoryif (options?.selectedTemplate && isFlagSelected) {@@ -98,10 +101,7 @@ export const resolveProjectRoot = async (options?: {});if (typeof answer === 'string') {- // Strip control characters (U+0000βU+001F, U+007F) that terminal- // emulators may inject via readline shortcuts (e.g. Ctrl+U β U+0015)- // eslint-disable-next-line no-control-regex- projectName = answer.replace(/[\x00-\x1f\x7f]/g, '').trim();+ projectName = stripControlChars(answer).trim();}}} catch (error) {