This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x # Enable debug mode | |
# Check if correct number of arguments are provided | |
if [ "$#" -ne 3 ]; then | |
echo "Usage: $0 <obsidian_file> <hugo_content_dir> <hugo_post_name>" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create a temporary file | |
temp_file=$(mktemp) | |
# Concatenate all non-empty .md files in the current directory, adding titles and separators | |
for file in *.md; do | |
if [ -f "$file" ] && [ -s "$file" ] && ! [ -z "$(grep -v '^[[:space:]]*$' "$file")" ]; then | |
echo -e "\n====== $file ======\n" >> "$temp_file" | |
cat "$file" >> "$temp_file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Error handling | |
function OwnError() | |
{ | |
echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)" | |
exit $2 | |
} | |
# Repository for rethinkdb |