Open renatocan opened 2 hours ago
This will only work with linux/WSL. Create a file and execute the following:
#!/bin/bash
# Directory containing the subfolders
PATTERNS_DIR="$HOME/.config/fabric/patterns"
# Check if the directory exists
if [ ! -d "$PATTERNS_DIR" ]; then
echo "Directory $PATTERNS_DIR does not exist."
exit 1
fi
# Loop over each subdirectory and create an alias
for subdir in "$PATTERNS_DIR"/*/; do
# Get the subdirectory name without the full path
subdir_name=$(basename "$subdir")
# Create the alias in the format 'alias <subdir_name>=fabric -p <subdir_name>'
echo "alias $subdir_name='fabric -p $subdir_name'"
done
you can then run:
echo 'what is your name' | raw_query
instead of
echo 'what is your name' | fabric -p raw_query
What is your question?
Before the migration to golang, there was a script to create aliases to the patterns that was automatically included to .bashrc and .zshrc, if I'm not wrong (fabric-bootstrap.inc). In the current version, I couldn't find this script.
Is there some easy way to create aliases to the patterns in the current version?
Thanks!
Renato.