fix: remove nested .git folders, re-add as normal directories

This commit is contained in:
2026-03-22 17:50:47 -05:00
parent f55c7e47c9
commit 6b7eec67b8
1870 changed files with 4170168 additions and 3 deletions
+41
View File
@@ -0,0 +1,41 @@
import { prisma } from "../src/constants";
await (async () => {
const userIdentifier = Bun.argv[2];
const roleIdentifier = Bun.argv[3];
if (Bun.argv.length !== 4)
console.error(
"2 arguments expected. \n Format: bun utils:assign_user_role {user} {role}"
);
const user = await prisma.user.findFirst({
where: { OR: [{ id: userIdentifier }, { login: userIdentifier }] },
});
if (!user)
return console.error(
`User with identifier '${userIdentifier}' doesn't exist`
);
const role = await prisma.role.findFirst({
where: { OR: [{ id: roleIdentifier }, { moniker: roleIdentifier }] },
include: { users: true },
});
if (!role)
return console.error(
`Role with identifier '${roleIdentifier}' doesn't exist`
);
if (role.users.map((v) => v.id).includes(user.id))
return console.log("User already has role!");
await prisma.user.update({
where: { id: user.id },
data: { roles: { set: { id: role.id } } },
});
return console.log(
`User '${user.login}' has been given role '${role.title}'!`
);
})();