Skip to content

Commit

Permalink
Skip subdirectories that aren't valid in-game usernames during `hsm p…
Browse files Browse the repository at this point in the history
…ush` (#225)

* Filter invalid usernames

* Change regex a little for consistency with those in `hsm.ts`
  • Loading branch information
danswann authored Dec 30, 2024
1 parent e4e0fd4 commit 43deef2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 != `*`),
Expand Down

0 comments on commit 43deef2

Please sign in to comment.