diff --git a/packages/usersplit/index.ts b/packages/usersplit/index.ts index 9ba96ce..81f1f1f 100644 --- a/packages/usersplit/index.ts +++ b/packages/usersplit/index.ts @@ -16,7 +16,7 @@ async function main({ outputFile: string; superadminFile: string; }) { - const superadminPassword = fs.readFileSync(path.join(__dirname, superadminFile), 'utf8'); + const superadminPassword = fs.readFileSync(path.join(__dirname, superadminFile), 'utf8').trim(); const lines = fs.readFileSync(path.join(__dirname, usersFile), 'utf8').split('\n'); const passwords = fs.readFileSync(path.join(__dirname, passwordsFile), 'utf8').split('\n'); @@ -45,6 +45,9 @@ async function main({ }); for (const line of lines) { + if (!line) { + continue; + } const [group, admin, username, password] = line.split(' '); let dbAdmin = await prisma.admin.findUnique({ where: {