From 43deef20fe8d41149cdc8e17e625d77180078fab Mon Sep 17 00:00:00 2001 From: Daniel Swann Date: Mon, 30 Dec 2024 12:20:25 -0500 Subject: [PATCH] Skip subdirectories that aren't valid in-game usernames during `hsm push` (#225) * Filter invalid usernames * Change regex a little for consistency with those in `hsm.ts` --- src/push.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/push.ts b/src/push.ts index 3232bca..7177c6c 100644 --- a/src/push.ts +++ b/src/push.ts @@ -79,7 +79,7 @@ export async function push( if (hackmudFolder instanceof Error) return hackmudFolder - const sourceFolderFolders = sourceFolder.filter(({ stats }) => stats.isDirectory()) + const sourceFolderFolders = sourceFolder.filter(({ name, stats }) => stats.isDirectory() && /^[a-z_][a-z\d_]{0,24}$/.test(name)) const allUsers = new Set([ ...scripts.map(scriptName => ensure(scriptName.split(`.`)[0], HERE)).filter(name => name != `*`),