From 93921e71d428c397d2f25d9a2b9932a5668d76ed Mon Sep 17 00:00:00 2001 From: erinhmclark Date: Wed, 19 Mar 2025 11:33:35 +0000 Subject: [PATCH] Clarify comments in pot scripts. --- scripts/potoken_provider/setup_pot_provider.sh | 11 +---------- scripts/potoken_provider/update_pot_provider.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/scripts/potoken_provider/setup_pot_provider.sh b/scripts/potoken_provider/setup_pot_provider.sh index 8d27e75..b533ea3 100755 --- a/scripts/potoken_provider/setup_pot_provider.sh +++ b/scripts/potoken_provider/setup_pot_provider.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e # Exit on error +set -e SCRIPTS_DIR="scripts/potoken_provider" TARGET_DIR="$SCRIPTS_DIR/bgutil-provider" @@ -11,7 +11,6 @@ if [ ! -d "$TARGET_DIR" ]; then exit 1 fi -# Move into the server directory cd "$TARGET_DIR" || exit 1 # Check if dependencies need installation @@ -31,12 +30,4 @@ else fi -## Ensure the script exists after transpilation -#if [ ! -f "$GEN_SCRIPT" ]; then -# echo "Error: PO Token script not found after attempting transpilation." -# exit 1 -#fi - - -# Confirm success echo "PO Token provider script is ready for use." diff --git a/scripts/potoken_provider/update_pot_provider.sh b/scripts/potoken_provider/update_pot_provider.sh index 29c8376..58113fc 100755 --- a/scripts/potoken_provider/update_pot_provider.sh +++ b/scripts/potoken_provider/update_pot_provider.sh @@ -1,26 +1,26 @@ #!/bin/bash -set -e # Exit on error +set -e SCRIPTS_DIR="scripts/potoken_provider" TARGET_DIR="$SCRIPTS_DIR/bgutil-provider" BGUTIL_REPO="https://github.com/Brainicism/bgutil-ytdlp-pot-provider.git" BGUTIL_TEMP_DIR="$SCRIPTS_DIR/bgutil-temp" -# Clone fresh copy into temporary directory +# Clone fresh copy of the POT generation script repo into temporary directory git clone --depth 1 "$BGUTIL_REPO" "$BGUTIL_TEMP_DIR" -# Ensure the target directory exists +# Ensure the target directory exists, clear for a fresh install rm -rf "$TARGET_DIR" mkdir -p "$TARGET_DIR" -# Copy only the contents inside /server/ into bgutil-provider +# Copy only the contents inside /server/ into bgutil-provider, +# as this is the part containing the PO Token generation script echo "Copy /server/ contents into $TARGET_DIR..." cp -r "$BGUTIL_TEMP_DIR/server/"* "$TARGET_DIR/" -# Clean up: remove the cloned repository +# Clean up: remove the cloned repository as we only needed the /server/ contents echo "Cleaning up temporary files..." rm -rf "$BGUTIL_TEMP_DIR" -# Confirm success echo "PO Token provider script is ready in: $TARGET_DIR/build" echo "Commit and push changes to include it in version control."