diff --git a/bin/nuxfs b/bin/nuxfs index 13b9f0f..f6eeb2c 100755 --- a/bin/nuxfs +++ b/bin/nuxfs @@ -10,7 +10,7 @@ nux.include nuxfs.dsl ## verify - Verifies that directory matches nuxfs specification function task.verify { - link-exists() { + link.exists() { nux.log debug "Testing '$1' as link" if test ! -h "$1"; then nuxfs.error "$1" "is not symlink." @@ -26,26 +26,26 @@ function task.verify { nuxfs.warning "$1" "target '$NC_White$2$NC_No' does not exists." fi } - def-notexists() { + def.notexists() { nuxfs.error "$1" "does not exists". } nuxfs.dsl.execute .nuxfs } -## create - Creates missing files as described in nuxfs definition. +## create - Creates missing files as described in nuxfs definition. function task.create { - directory-notexists() { + directory.notexists() { nuxfs.info "$1" "Created directory"; mkdir -p "$1" } - link-notexists() { + link.notexists() { nuxfs.info "$1" "Creating link to '$2'"; ln -s "$2" "$1" } - git-notexists() { + git.notexists() { log.warning "Not implemented"; } diff --git a/inc/nuxfs.dsl.inc.sh b/inc/nuxfs.dsl.inc.sh index 90433ab..dfb909a 100644 --- a/inc/nuxfs.dsl.inc.sh +++ b/inc/nuxfs.dsl.inc.sh @@ -25,17 +25,17 @@ function nuxfs.dsl.command { nux.log debug Processing $CMD "$localFile" $@; - exec.if.function $CMD-pre "$localFile" "$@"; + exec.if.function $CMD.pre "$localFile" "$@"; nux.log debug Working file: $NC_White$localFile; if nuxfs.file.exists "$localFile"; then nux.log debug "File $localFile exits"; - exec.if.function $CMD-exists def-exists "$localFile" "$@"; + exec.if.function $CMD.exists def.exists "$localFile" "$@"; else nux.log debug "File $localFile does not exists"; - exec.if.function $CMD-notexists def-notexists "$localFile" "$@"; + exec.if.function $CMD.notexists def.notexists "$localFile" "$@"; fi - exec.if.function $CMD-post def-post "$localFile" "$@"; + exec.if.function $CMD.post def.post "$localFile" "$@"; } @@ -61,12 +61,12 @@ function nuxfs.dsl.keywords { #echo git clone $1 $2; } - directory-post() { + directory.post() { nuxfs.dir.push "$1" nux.log debug "Adding to dir stack: $1" } - directory-exists() { + directory.exists() { if test -d "$1"; then nux.log debug "Directory exists '$1'" else