Prebuild script

This commit is contained in:
Brandon Rozek 2024-07-28 19:59:08 -07:00
parent 5025642c44
commit 1107a08a1c
No known key found for this signature in database
GPG key ID: 26E457DA82C9F480
2 changed files with 21 additions and 4 deletions

View file

@ -44,15 +44,14 @@ jobs:
sudo apt update sudo apt update
sudo apt install -y rustc cargo sudo apt install -y rustc cargo
- name: Build - name: Build Website-Toots
run: | run: |
cd content/toots/.scripts cd content/toots/.scripts
cargo build --release cargo build --release
- name: Generate Hugo Markdown for Toots - name: Pre-build script
run: | run: |
cd content/toots/.scripts ./build.sh
./target/release/generate_md
- name: Build Hugo Website - name: Build Hugo Website
id: build id: build

18
build.sh Normal file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env sh
# Generate toot markdown files
pushd content/toots/.scripts > /dev/null
generate_exe="./target/release/generate_md"
# Check if the file exists and is executable
if [ -e "$generate_exe" ] && [ -x "$generate_exe" ]; then
echo "The file '$file_path' exists and is executable."
./target/release/generate_md
else
echo "The executable '$generate_exe' does not exist."
echo "Perhaps run cargo build in 'content/toots/.scripts'?"
fi
popd > /dev/null