Skip to content

Commit

Permalink
refactor: DRY up static site build code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Feb 21, 2025
1 parent 433ffae commit 945422c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
44 changes: 18 additions & 26 deletions archive-static-sites/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,23 @@
# Change to the directory of the script
cd "$(dirname "$0")"

# Build the archive static sites
echo ">> Building X archive static site..."
rm -f x-archive/public/assets/archive.js
cd x-archive
rm -r dist || true
npm install
npm run build
build_archive_site() {
site=$1
echo ">> Building ${site} archive static site..."
rm -f ${site}-archive/public/assets/archive.js
cd ${site}-archive
rm -r dist || true
npm install
npm run build

# Zip it up
cd dist
mkdir -p ../../../build/
rm -f ../../../build/x-archive.zip
zip -r ../../../build/x-archive.zip .
cd ../..
# Zip it up
cd dist
mkdir -p ../../../build/
rm -f ../../../build/${site}-archive.zip
zip -r ../../../build/${site}-archive.zip .
cd ../..
}

echo ">> Building Facebook archive static site..."
rm -f facebook-archive/public/assets/archive.js
cd facebook-archive
rm -r dist || true
npm install
npm run build

# Zip it up
cd dist
mkdir -p ../../../build/
rm -f ../../../build/facebook-archive.zip
zip -r ../../../build/facebook-archive.zip .
cd ../..
# Build each site
build_archive_site x
build_archive_site facebook
1 change: 0 additions & 1 deletion src/account_facebook/facebook_account_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ export class FacebookAccountController {
postID: post.postID,
createdAt: post.createdAt,
text: post.text,
path: post.path,
archivedAt: post.archivedAt,
};
return archivePost
Expand Down

0 comments on commit 945422c

Please sign in to comment.