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

nuxfs: Added support for custom / folder specific DSL

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2017-06-10 21:25:52 +02:00
parent d3be24f3d7
commit 5d69659e3c
5 changed files with 102 additions and 80 deletions

35
inc/dsl/nuxfs.dsl Normal file
View file

@ -0,0 +1,35 @@
.block dir name
.keyword link name target
.keyword git name origin
.keyword origin
.keyword name name
.keyword template
.keyword exists
directory() {
dir
}
sdir() {
dir "$@"
enddir
}
.allways.preprocess() {
abs_path=$(realpath -Lms "$NUXFS_DEF_DIR/$path");
rel_path=$(realpath -Lms "$abs_path" --relative-base="$WORKDIR");
}
.check() {
nux.log trace "Checking existence of $NC_White$abs_path$NC_No"
nux.check.file.exists "$abs_path"
}
.check.failed() {
nux.dsl.error "$abs_path" does not exists.
}
dir.entered() {
if nux.check.file.exists "$abs_path/.nuxfs"; then
source "$abs_path/.nuxfs"
fi
}