1
0
silverbullet/scripts/build_website.sh

27 lines
853 B
Bash
Raw Normal View History

2022-08-01 09:38:22 +00:00
#!/bin/bash
2022-07-15 09:36:11 +00:00
2022-08-01 09:25:59 +00:00
echo "Building silver bullet"
2022-07-15 13:33:40 +00:00
npm run clean-build
2022-08-01 09:25:59 +00:00
echo "Cleaning website build dir"
2022-07-15 12:59:47 +00:00
rm -rf website_build
mkdir -p website_build/fs/_plug
2022-08-01 09:25:59 +00:00
echo "Copying silverbullet runtime files"
2022-07-15 12:59:47 +00:00
cp -r packages/web/dist/* website_build/
2022-08-01 09:25:59 +00:00
echo "Copying netlify config files"
cp website/{_redirects,_headers} website_build/
echo "Copying website markdown files"
2022-07-15 12:59:47 +00:00
cp -r website/* website_build/fs/
2022-08-01 09:25:59 +00:00
rm website_build/fs/{_redirects,_headers}
echo "Copying standard set of plugs"
2022-07-15 12:59:47 +00:00
cp packages/plugs/dist/* website_build/fs/_plug/
2022-08-01 09:25:59 +00:00
echo "Applying rename magic"
2022-07-15 12:59:47 +00:00
find website_build/fs/ -depth -name "*.md" -exec sh -c 'mv "$1" "${1%.md}"' _ {} \;
find website_build/fs/ -depth -name "*.plug.json" -exec sh -c 'mv "$1" "${1%.plug.json}"' _ {} \;
2022-08-01 09:25:59 +00:00
echo "Generating file listing"
node scripts/generate_fs_list.js > website_build/index.json
2022-08-01 09:25:59 +00:00
echo > website_build/empty.md