2022-09-05 14:33:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-10-29 14:27:16 +00:00
|
|
|
echo "Install Deno"
|
2022-11-25 18:43:54 +00:00
|
|
|
curl -fsSL https://deno.land/install.sh | sh
|
|
|
|
export PATH=~/.deno/bin:$PATH
|
2022-10-29 14:27:16 +00:00
|
|
|
|
2022-11-29 07:19:01 +00:00
|
|
|
echo "Generating version number..."
|
|
|
|
echo "export const version = '$(git rev-parse HEAD)';" > version.ts
|
|
|
|
|
2022-09-05 14:33:56 +00:00
|
|
|
echo "Building silver bullet"
|
2022-10-29 14:27:16 +00:00
|
|
|
deno task build
|
2022-09-05 14:33:56 +00:00
|
|
|
echo "Cleaning website build dir"
|
|
|
|
rm -rf website_build
|
2022-09-13 06:46:30 +00:00
|
|
|
mkdir -p website_build/fs/_plug
|
2022-09-05 14:33:56 +00:00
|
|
|
echo "Copying silverbullet runtime files"
|
2022-10-29 14:27:16 +00:00
|
|
|
cp -r dist_bundle/web/* website_build/
|
2022-11-25 18:43:54 +00:00
|
|
|
|
|
|
|
echo "And all plugs"
|
2022-10-29 14:27:16 +00:00
|
|
|
cp -r dist_bundle/_plug/* website_build/fs/_plug/
|
2023-01-16 15:45:55 +00:00
|
|
|
echo "And additional ones"
|
|
|
|
curl https://raw.githubusercontent.com/silverbulletmd/silverbullet-mermaid/main/mermaid.plug.json > website_build/fs/_plug/mermaid.plug.json
|
2022-11-25 18:43:54 +00:00
|
|
|
echo "But remove some plugs"
|
2022-11-25 18:46:52 +00:00
|
|
|
rm -rf website_build/fs/_plug/{directive,plugmd,publish,share}.plug.json
|
2022-11-25 18:43:54 +00:00
|
|
|
#echo "Copying netlify config files"
|
|
|
|
#cp website/{_redirects,_headers} website_build/
|
2022-09-05 14:33:56 +00:00
|
|
|
|
2022-11-25 18:43:54 +00:00
|
|
|
echo "Copying website content into fs/"
|
2022-09-13 06:46:30 +00:00
|
|
|
cp -r website/* website_build/fs/
|
|
|
|
rm website_build/fs/{_redirects,_headers}
|
2022-09-05 14:33:56 +00:00
|
|
|
|
2022-11-25 18:43:54 +00:00
|
|
|
echo "Copy website files another time into the root"
|
|
|
|
cp -r website/* website_build/
|
|
|
|
|
2022-09-05 14:33:56 +00:00
|
|
|
echo "Generating file listing"
|
2022-10-29 14:27:16 +00:00
|
|
|
deno run -A scripts/generate_fs_list.ts > website_build/index.json
|
2022-09-05 14:33:56 +00:00
|
|
|
|
|
|
|
echo > website_build/empty.md
|
|
|
|
|
2022-11-25 17:01:40 +00:00
|
|
|
echo "Bundling..."
|
|
|
|
deno task bundle
|
|
|
|
cp dist/silverbullet.js website_build/
|
|
|
|
cp dist_bundle/web/global.plug.json website_build/
|
2023-01-14 14:00:30 +00:00
|
|
|
cp web/images/logo.ico website_build/
|