1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00
nux-env/bin/nudsl

42 lines
688 B
Text
Executable file

#!/usr/bin/env nux-runner
#nux.use nudsl
## highlight:: <language> <file>
task.highlight() {
nux.dsl.process highlight nux.nuxsh.language.def "$2"
}
task.language.show() {
nudsl.language.cache lang.yanglike.def
}
task.plan() {
nuxr.run.subtask "$@"
}
task.plan.compile() {
nux.use nudsl/$1
nudsl.plan lang.$1.def "$2"
}
task.plan.preview() {
nux.dsl.plan nux.nuxsh.language "$2"
plan="$(nudsl.plan.file "$1" "$2")"
if [ -e "$plan" ]; then
if [ -n "$(which pygmentize)" ]; then
pygmentize -l bash "$plan";
else
cat "$plan";
fi
else
echo "Plan not available"
fi
}
task.run() {
echo "$@"
nudsl.process "lang.yanglike.def" "$2"
}