Skip to content

Instantly share code, notes, and snippets.

@oatsandsugar
Created January 31, 2025 19:13
Show Gist options
  • Save oatsandsugar/920ef60dce8799ce9b4a7997b8b26c0a to your computer and use it in GitHub Desktop.
Save oatsandsugar/920ef60dce8799ce9b4a7997b8b26c0a to your computer and use it in GitHub Desktop.
#!/bin/bash
# Define the project directory
PROJECT_DIR="."
# Define directories to clean
DIRS=(
"$PROJECT_DIR/.aurora/"
"$PROJECT_DIR/app/datamodels/"
"$PROJECT_DIR/app/functions/"
"$PROJECT_DIR/app/scripts/"
)
# Delete all files in the specified directories
for DIR in "${DIRS[@]}"; do
if [ -d "$DIR" ]; then
echo "Cleaning up $DIR"
rm -rf "$DIR"/*
else
echo "Directory $DIR does not exist, skipping."
fi
done
# Truncate moose.config.toml from line 30 onwards
CONFIG_FILE="$PROJECT_DIR/moose.config.toml"
if [ -f "$CONFIG_FILE" ]; then
echo "Truncating $CONFIG_FILE from line 30 onwards"
head -n 29 "$CONFIG_FILE" > "$CONFIG_FILE.tmp" && mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
else
echo "$CONFIG_FILE does not exist, skipping."
fi
echo "Cleanup complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment