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

Added small updates.

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2017-06-19 15:31:11 +02:00
parent 429a0d3258
commit e7bb96f730
4 changed files with 19 additions and 4 deletions

View file

@ -18,6 +18,17 @@ task.update() {
popd > /dev/null popd > /dev/null
} }
## install Install nux-env recommended binaries if not present
##
task.install() { task.install() {
: :
}
## help.inc <inc>
## Displays help for specified nuxs-env library.
##
task.help.inc() {
local name="$1"
nux.help.comment $NUX_INC_DIR/$name.inc.sh
} }

0
inc/dsl/nux.fs.inc.sh Normal file
View file

View file

@ -1,7 +1,4 @@
## #nux-base - NUX Script Base library ## #nux-base - NUX Script Base library
##
readonly NUX_INC_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) readonly NUX_INC_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
readonly NUX_ENV_DIR=$(dirname $NUX_INC_DIR) readonly NUX_ENV_DIR=$(dirname $NUX_INC_DIR)
@ -196,6 +193,13 @@ function nux.help.shelldoc {
} }
function nux.url.parse {
format=${2:-"protocol:\2\nuser:\4\nhost:\5\nport:\7 \npath:\8"}
echo "$1" | sed \
-re "s/(([^:\/]*):\/\/)?(([^@\/:]*)@)?([^:\/]+)(:([0-9]+))?(\/(.*))?/$format/g"
}
NUX_ENV_MACHINE=/usr/ NUX_ENV_MACHINE=/usr/
NUX_ENV_MACHINE_LOCAL=/usr/local/ NUX_ENV_MACHINE_LOCAL=/usr/local/
NUX_ENV_USER_LOCAL=$HOME/.local NUX_ENV_USER_LOCAL=$HOME/.local

View file

@ -40,7 +40,7 @@ function nuxfs.file.exists {
function nuxfs.closest { function nuxfs.closest {
cmd=$1; cmd=$1;
cdir=$2; cdir=${2:-$(pwd)};
nux.log trace "Searching in: " $cdir; nux.log trace "Searching in: " $cdir;
until [ -e "$cdir/$1" -o "$cdir" == "/" ]; do until [ -e "$cdir/$1" -o "$cdir" == "/" ]; do
cdir=$(dirname "$cdir"); cdir=$(dirname "$cdir");