kopia lustrzana https://github.com/bellingcat/auto-archiver
Update directory location, add .gitignore
rodzic
cb632723bd
commit
b83bfda187
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
bgutil-provider/node_modules
|
|
@ -3,17 +3,16 @@ set -e # Exit on error
|
||||||
|
|
||||||
SCRIPTS_DIR="scripts/potoken_provider"
|
SCRIPTS_DIR="scripts/potoken_provider"
|
||||||
TARGET_DIR="$SCRIPTS_DIR/bgutil-provider"
|
TARGET_DIR="$SCRIPTS_DIR/bgutil-provider"
|
||||||
SERVER_DIR="$TARGET_DIR/server"
|
GEN_SCRIPT="$TARGET_DIR/build/generate_once.js"
|
||||||
GEN_SCRIPT="$SERVER_DIR/build/generate_once.js"
|
|
||||||
|
|
||||||
# Ensure the server directory exists
|
# Ensure the server directory exists
|
||||||
if [ ! -d "$SERVER_DIR" ]; then
|
if [ ! -d "$TARGET_DIR" ]; then
|
||||||
echo "Error: PO Token provider server directory is missing! Please run update_pot_provider.sh first."
|
echo "Error: PO Token provider server directory is missing! Please run update_pot_provider.sh first."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Move into the server directory
|
# Move into the server directory
|
||||||
cd "$SERVER_DIR" || exit 1
|
cd "$TARGET_DIR" || exit 1
|
||||||
|
|
||||||
# Check if dependencies need installation
|
# Check if dependencies need installation
|
||||||
if [ ! -d "node_modules" ]; then
|
if [ ! -d "node_modules" ]; then
|
||||||
|
@ -24,7 +23,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if build directory exists and if transpiling is needed
|
# Check if build directory exists and if transpiling is needed
|
||||||
if [ ! -d "build" ] || [ "$SERVER_DIR/src" -nt "$GEN_SCRIPT" ]; then
|
if [ ! -d "build" ] || [ "src" -nt "$GEN_SCRIPT" ]; then
|
||||||
echo "Build directory missing or outdated. Running transpilation..."
|
echo "Build directory missing or outdated. Running transpilation..."
|
||||||
npx tsc
|
npx tsc
|
||||||
else
|
else
|
||||||
|
|
|
@ -6,22 +6,21 @@ TARGET_DIR="$SCRIPTS_DIR/bgutil-provider"
|
||||||
BGUTIL_REPO="https://github.com/Brainicism/bgutil-ytdlp-pot-provider.git"
|
BGUTIL_REPO="https://github.com/Brainicism/bgutil-ytdlp-pot-provider.git"
|
||||||
BGUTIL_TEMP_DIR="$SCRIPTS_DIR/bgutil-temp"
|
BGUTIL_TEMP_DIR="$SCRIPTS_DIR/bgutil-temp"
|
||||||
|
|
||||||
|
|
||||||
# Clone fresh copy into temporary directory
|
# Clone fresh copy into temporary directory
|
||||||
git clone --depth 1 "$REPO_URL" "$TMP_DIR"
|
git clone --depth 1 "$BGUTIL_REPO" "$BGUTIL_TEMP_DIR"
|
||||||
|
|
||||||
# Ensure the target directory exists
|
# Ensure the target directory exists
|
||||||
rm -rf "$TARGET_DIR"
|
rm -rf "$TARGET_DIR"
|
||||||
mkdir -p "$TARGET_DIR"
|
mkdir -p "$TARGET_DIR"
|
||||||
|
|
||||||
# Copy the entire server directory
|
# Copy only the contents inside /server/ into bgutil-provider
|
||||||
echo "Copying /server/ directory..."
|
echo "Copy /server/ contents into $TARGET_DIR..."
|
||||||
cp -r "$BGUTIL_TEMP_DIR/server" "$TARGET_DIR/"
|
cp -r "$BGUTIL_TEMP_DIR/server/"* "$TARGET_DIR/"
|
||||||
|
|
||||||
# Clean up: remove the cloned repository
|
# Clean up: remove the cloned repository
|
||||||
echo "Cleaning up temporary files..."
|
echo "Cleaning up temporary files..."
|
||||||
rm -rf "$BGUTIL_TEMP_DIR"
|
rm -rf "$BGUTIL_TEMP_DIR"
|
||||||
|
|
||||||
# Confirm success
|
# Confirm success
|
||||||
echo "PO Token provider script is ready in: $TARGET_DIR/server"
|
echo "PO Token provider script is ready in: $TARGET_DIR/build"
|
||||||
echo "Commit and push changes to include it in version control."
|
echo "Commit and push changes to include it in version control."
|
||||||
|
|
Ładowanie…
Reference in New Issue