lindholm.dev/scripts/generate-blog-posts.sh
Ville Lindholm cc6c1f46f9
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
add obsidian vault as source for blogging
2025-05-29 16:29:37 +03:00

31 lines
797 B
Bash
Executable File

#!/bin/bash
# Detect the platform
PLATFORM="$(uname -s)"
ARCH="$(uname -m)"
# Determine which binary to use
if [ "$PLATFORM" = "Darwin" ]; then
if [ "$ARCH" = "arm64" ]; then
BINARY="obsidian-export-aarch64-apple-darwin"
else
echo "Unsupported architecture on macOS: $ARCH"
exit 1
fi
elif [ "$PLATFORM" = "Linux" ]; then
if [ "$ARCH" = "x86_64" ]; then
BINARY="obsidian-export-x86_64_unknown-linux-gnu"
else
echo "Unsupported architecture on Linux: $ARCH"
exit 1
fi
else
echo "Unsupported platform: $PLATFORM"
exit 1
fi
# Make sure the binary is executable
chmod +x "$BINARY"
# Run the appropriate binary
./"$BINARY" --start-at content-sources/obsidian-default/Blog content-sources/obsidian-default/ content/blog/