mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
Added foldy management tools
This commit is contained in:
parent
a93306cb79
commit
f69327b2ca
1 changed files with 30 additions and 19 deletions
49
bin/foldy
49
bin/foldy
|
|
@ -3,10 +3,19 @@ nux.use nux/fs
|
||||||
|
|
||||||
CLOSEST=$(nux.fs.closest .foldy.nuxsh)
|
CLOSEST=$(nux.fs.closest .foldy.nuxsh)
|
||||||
|
|
||||||
## suffix:: <file>
|
## list:: List Available foldy integrated directories
|
||||||
## Adds random UUID suffix to file names if file does not have UUID in name already.
|
|
||||||
@command list {
|
@command list {
|
||||||
nux.fs.info "Listing foldy files in $CLOSEST"
|
#nux.fs.info "Listing foldy files in $CLOSEST"
|
||||||
|
find -iname ".foldy.nuxsh" | while read line; do
|
||||||
|
echo "${line%.foldy.nuxsh}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
## exec:: <path> <command> [<args>]
|
||||||
|
## Run foldy command in directory.
|
||||||
|
@command run path command {
|
||||||
|
(cd $path; foldy $command "$@" )
|
||||||
}
|
}
|
||||||
|
|
||||||
@command help.additional {
|
@command help.additional {
|
||||||
|
|
@ -16,20 +25,22 @@ CLOSEST=$(nux.fs.closest .foldy.nuxsh)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nuxr.run.additional {
|
@namespace nuxr.run. {
|
||||||
if [[ -f "$CLOSEST" ]]; then
|
function :additional TASK {
|
||||||
nux.log debug Loading sources fron "$CLOSEST"
|
if [[ -f "$CLOSEST" ]]; then
|
||||||
|
nux.log debug Loading sources fron "$CLOSEST"
|
||||||
nux.nuxsh.use "$CLOSEST"
|
|
||||||
fi
|
nux.nuxsh.use "$CLOSEST"
|
||||||
|
fi
|
||||||
if nux.check.function task.$TASK; then
|
|
||||||
nux.log debug "Running task: $TASK";
|
if nux.check.function task.$TASK; then
|
||||||
nux.log debug "Working dir: $(pwd)"
|
nux.log debug "Running task: $TASK";
|
||||||
task.$TASK "$@" # Runs task
|
nux.log debug "Working dir: $(pwd)"
|
||||||
else
|
task.$TASK "$@" # Runs task
|
||||||
echo "$NUX_SCRIPTNAME: Unrecognized task '$TASK' not available."
|
else
|
||||||
echo "Try '$NUX_SCRIPTNAME help' for more information."
|
echo "$NUX_SCRIPTNAME: Unrecognized task '$TASK' not available."
|
||||||
return -1
|
echo "Try '$NUX_SCRIPTNAME help' for more information."
|
||||||
fi
|
return -1
|
||||||
|
fi
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue