Small PNID script change

This commit is contained in:
Matthew Lopez 2023-12-22 16:41:54 -05:00
parent 2be0d8c582
commit d0041b297f
No known key found for this signature in database
GPG Key ID: 302A6EE3D63B7E0E
2 changed files with 5 additions and 5 deletions

View File

@ -6,14 +6,14 @@ const { PNID } = require("./dist/models/pnid");
async function runAsync() {
await connect();
if (process.env.PNID) {
if (process.argv[1]) {
const pnid = await PNID.findOne({
usernameLower: process.env.PNID.toLowerCase(),
usernameLower: process.argv[1].toLowerCase(),
});
if (pnid) {
await updatePnidAccessLevel(pnid, 3, "dev");
} else {
console.log(`No PNID found for username ${process.env.PNID}.`);
console.log(`No PNID found for username ${process.argv[1]}.`);
}
} else {
console.log("No username given, skipping update.");

View File

@ -9,8 +9,8 @@ done
git_base=$(git rev-parse --show-toplevel)
create_server_script=$(cat "$git_base/scripts/run-in-container/create-server-in-database.js")
create_endpoint_script=$(cat "$git_base/scripts/run-in-container/create-endpoint-in-database.js")
update_pnid_access_level_script=$(cat "$git_base/scripts/run-in-container/update-pnid-access-level-in-database.js")
create_endpoint_script=$(cat "$git_base/scripts/run-in-container/create-endpoint-in-database.js")
necessary_environment="friends miiverse-api wiiu-chat"
. "$git_base/environment/system.local.env"
@ -30,7 +30,7 @@ docker compose exec -e COMPUTER_IP="$COMPUTER_IP" \
printf "Enter the PNID you want to give dev access to: "
read -r dev_pnid
docker compose exec -e PNID="$dev_pnid" account node -e "$update_pnid_access_level_script"
docker compose exec account node -e "$update_pnid_access_level_script" "$dev_pnid"
docker compose up -d miiverse-api