Skip to content

Commit 03daa4e

Browse files
committed
refactor: DRY up static site build code a bit
1 parent be9bb92 commit 03daa4e

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

archive-static-sites/build.sh

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,23 @@
33
# Change to the directory of the script
44
cd "$(dirname "$0")"
55

6-
# Build the archive static sites
7-
echo ">> Building X archive static site..."
8-
rm -f x-archive/public/assets/archive.js
9-
cd x-archive
10-
rm -r dist || true
11-
npm install
12-
npm run build
6+
build_archive_site() {
7+
site=$1
8+
echo ">> Building ${site} archive static site..."
9+
rm -f ${site}-archive/public/assets/archive.js
10+
cd ${site}-archive
11+
rm -r dist || true
12+
npm install
13+
npm run build
1314

14-
# Zip it up
15-
cd dist
16-
mkdir -p ../../../build/
17-
rm -f ../../../build/x-archive.zip
18-
zip -r ../../../build/x-archive.zip .
19-
cd ../..
15+
# Zip it up
16+
cd dist
17+
mkdir -p ../../../build/
18+
rm -f ../../../build/${site}-archive.zip
19+
zip -r ../../../build/${site}-archive.zip .
20+
cd ../..
21+
}
2022

21-
echo ">> Building Facebook archive static site..."
22-
rm -f facebook-archive/public/assets/archive.js
23-
cd facebook-archive
24-
rm -r dist || true
25-
npm install
26-
npm run build
27-
28-
# Zip it up
29-
cd dist
30-
mkdir -p ../../../build/
31-
rm -f ../../../build/facebook-archive.zip
32-
zip -r ../../../build/facebook-archive.zip .
33-
cd ../..
23+
# Build each site
24+
build_archive_site x
25+
build_archive_site facebook

src/account_facebook/facebook_account_controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ export class FacebookAccountController {
234234
postID: post.postID,
235235
createdAt: post.createdAt,
236236
text: post.text,
237-
path: post.path,
238237
archivedAt: post.archivedAt,
239238
};
240239
return archivePost

0 commit comments

Comments
 (0)