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

Compare commits

...

3 commits

Author SHA1 Message Date
f69327b2ca Added foldy management tools 2025-07-23 14:22:02 +02:00
a93306cb79 medie: Default JPEG quality is 90 2025-07-23 13:50:49 +02:00
5b31a1c69e Added foldy 2025-07-23 13:50:21 +02:00
3 changed files with 52 additions and 3 deletions

46
bin/foldy Executable file
View file

@ -0,0 +1,46 @@
#!/usr/bin/env nuxr-nuxsh
nux.use nux/fs
CLOSEST=$(nux.fs.closest .foldy.nuxsh)
## list:: List Available foldy integrated directories
@command list {
#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 {
echo "Tasks defined in ${NC_White}$CLOSEST${NC_No}"
echo "Custom Help"
nux.help.comment "$CLOSEST"
}
@namespace nuxr.run. {
function :additional TASK {
if [[ -f "$CLOSEST" ]]; then
nux.log debug Loading sources fron "$CLOSEST"
nux.nuxsh.use "$CLOSEST"
fi
if nux.check.function task.$TASK; then
nux.log debug "Running task: $TASK";
nux.log debug "Working dir: $(pwd)"
task.$TASK "$@" # Runs task
else
echo "$NUX_SCRIPTNAME: Unrecognized task '$TASK' not available."
echo "Try '$NUX_SCRIPTNAME help' for more information."
return -1
fi
}
}

View file

@ -10,7 +10,7 @@ type ffmpeg > /dev/null 2>&1 && FFMPEG_OR_LIBAV=ffmpeg
type avconv > /dev/null 2>&1 && FFMPEG_OR_LIBAV=avconv
type gm > /dev/null 2>&1 && NUX_MAGICK=gm
QUALITY=${QUALITY:=95}
QUALITY=${QUALITY:=90}
DUPLICATE_THRESHOLD=${DUPLICATE_THRESHOLD:=90%}
SKIP_CHECK=no_skip
nux.log debug "FFMPEG: $FFMPEG_OR_LIBAV Magick: $NUX_MAGICK"

View file

@ -8,15 +8,18 @@ nux.use nux/help
@namespace nuxr. {
function :run TASK {
# FIXME: Add default task
if check:function task.$TASK {
if nux.check.function task.$TASK; then
nux.log debug "Running task: $TASK";
nux.log debug "Working dir: $(pwd)"
task.$TASK "$@" # Runs task
elif nux.check.function nuxr.run.additional; then
nux.log debug "Running additional task: $TASK";
nuxr.run.additional "$TASK" "$@"
else
echo "$NUX_SCRIPTNAME: Unrecognized task '$TASK' not available."
echo "Try '$NUX_SCRIPTNAME help' for more information."
return -1
}
fi
}
function :run.subtask SUBTASK {