mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-08-04 08:59:38 -05:00
Small PNID script change
This commit is contained in:
parent
2be0d8c582
commit
d0041b297f
|
|
@ -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.");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user