-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features request: Sailfish cli tool #147
Comments
Check out rust build macros. That's what I use to copy things over for my builds, along with running the tailwindCSS executable to minify my CSS. https://doc.rust-lang.org/cargo/reference/build-scripts.html If you need a starter, I can give you some of my build script code. |
Here's my
|
Thanks for sharing! My approach is simpler, it would be something like this: You can of sailfish-cli is a general tool just like tera-cli https://github.com/chevdor/tera-cli |
Would this bash script suffice? #!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 path_a path_b"
exit 1
fi
path_a="$1"
path_b="$2"
if [ ! -d "$path_b" ]; then
mkdir -p "$path_b"
fi
for file in "$path_a"/*; do
filename=$(basename "$file")
# Check if file has .stpl extension
if [[ "$filename" == *.stpl ]]; then
new_filename="${filename%.stpl}"
mv "$file" "$path_b/$new_filename"
else
mv "$file" "$path_b/$filename"
fi
done |
This doesn't include the part of translating stpl file. The copy part with script is easy, hard part is doing translate recursively the whole directory without writing macro like what we normally do with sailfish. That's why I ask about how to use sailfish compiler directly. |
Features:
I need a sailfish-cli tool to transform a nested folder
a
to folderb
, will transform all files with ext.stpl tob
same folder structure with files without .stpl. I have looked into sailfish and compiler, it mostly support macro for now which is a bit hard to navigate around.The dictionaries data to do the translation can be environment variable or config file through
--config, -c
If there is any hint to get it done? Thanks
The text was updated successfully, but these errors were encountered: