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

Updated files to use nux/* instead of nux.

This commit is contained in:
Tony Tkáčik 2021-03-24 21:31:40 +01:00
parent f5b7b183d2
commit d30931c3df
9 changed files with 17 additions and 21 deletions

View file

@ -1,16 +1,11 @@
@namespace nux.repl. {
## nux.repl.start <processor> [<prompt>] [<complete>]
## Starts NUX REPL
##
## FIXME: Add autocompletion
function nux.repl.start {
function .null() {
:
}
local processor=$1;
local prompt=${2:-.null};
local complete=$3;
function :start processor prompt complete {
local command=""
if nux.check.function $complete; then
@ -40,10 +35,7 @@ function nux.repl.start {
## This function is modified version of
## https://github.com/mchav/with/blob/master/with
function nux.repl.completion() {
local prompt=$1;
local compgen_command=$2;
shift;shift;
function :completion prompt compgen_command {
# print readline's prompt for visual separation
if [ "$#" -eq 0 ]; then
echo "$($prompt)$READLINE_LINE"
@ -118,3 +110,5 @@ function nux.repl.completion() {
for completion in "${COMPREPLY[@]}"; do echo "$completion"; done | column
fi
}
}

View file

@ -41,7 +41,7 @@ nux.use nuxr/repl
### Runs an interactive taskie shell with base taskie commands available.
###
function :interactive() {
nux.use nux.repl
nux.use nux/repl
nux.repl.start nuxr.repl.process nuxr.repl.prompt nuxr.repl.completer
}

View file

@ -1,8 +1,9 @@
nux.use nux/fs
nux.log debug "Backend Dir loaded"
backend.dir.detect() {
local dottaskie=$(nuxfs.closest .taskie "$1")
local dottaskiedir=$(nuxfs.closest .taskie.self "$1")
local dottaskie=$(nux.fs.closest .taskie "$1")
local dottaskiedir=$(nux.fs.closest .taskie.self "$1")
if [ -d "$dottaskie" ]; then
echo "$dottaskie"
elif [ -f "$dottaskie" -a "$(yaml r "$dottaskie" backend)" = "dir:self" ]; then

View file

@ -22,7 +22,7 @@ backend.github.with() {
}
backend.github.detect() {
closest_git=$(nuxfs.closest .git "$1")
closest_git=$(nux.fs.closest .git "$1")
git.origins "$closest_git" | grep github.com | while read origin
do

View file

@ -5,7 +5,7 @@ nux.use nux.json
githublike gogs
backend.gogs.detect() {
closest_git=$(nuxfs.closest .git "$1")
closest_git=$(nux.fs.closest .git "$1")
git.origins "$closest_git" | while read origin
do
nux.log debug Testing backend for: $origin