mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
Fixed nux-env and taskie
This commit is contained in:
parent
b04b28f5ea
commit
1cc5b48e4f
4 changed files with 43 additions and 12 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
## highlight:: <language> <file>
|
## highlight:: <language> <file>
|
||||||
|
|
||||||
task.highlight() {
|
task.highlight() {
|
||||||
|
nux.use nux/nuxsh
|
||||||
nux.dsl.process highlight nux.nuxsh.language.def "$2"
|
nux.dsl.process highlight nux.nuxsh.language.def "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23,8 +23,10 @@ task.plan.compile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
task.plan.preview() {
|
task.plan.preview() {
|
||||||
nux.dsl.plan nux.nuxsh.language "$2"
|
nux.use nux/nuxsh
|
||||||
plan="$(nudsl.plan.file "$1" "$2")"
|
nux.dsl.plan nux.nuxsh.language.def "$1"
|
||||||
|
plan="$(nudsl.plan.file nux.nuxsh.language.def "$1")"
|
||||||
|
nux.log info "Plan file: $plan"
|
||||||
if [ -e "$plan" ]; then
|
if [ -e "$plan" ]; then
|
||||||
if [ -n "$(which pygmentize)" ]; then
|
if [ -n "$(which pygmentize)" ]; then
|
||||||
pygmentize -l bash "$plan";
|
pygmentize -l bash "$plan";
|
||||||
|
|
|
||||||
31
bin/nux-env
31
bin/nux-env
|
|
@ -1,9 +1,9 @@
|
||||||
#!/usr/bin/env nuxr-nuxsh
|
#!/usr/bin/env nuxr-nuxsh
|
||||||
## Portable *nix environment by tonydamage
|
## Portable *nix environment by tonydamage
|
||||||
|
|
||||||
|
##
|
||||||
## status::
|
## status::
|
||||||
## Show status of nux-env installation
|
## Show status of nux-env installation
|
||||||
|
|
||||||
@namespace task. {
|
@namespace task. {
|
||||||
function :status {
|
function :status {
|
||||||
echo nux-env folder: $NUX_ENV_DIR
|
echo nux-env folder: $NUX_ENV_DIR
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##
|
||||||
## update::
|
## update::
|
||||||
## pulls latest nux-env from repository.
|
## pulls latest nux-env from repository.
|
||||||
function :update {
|
function :update {
|
||||||
|
|
@ -22,12 +23,35 @@
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##
|
||||||
## install::
|
## install::
|
||||||
## Install nux-env recommended binaries if not present
|
## Install nux-env recommended binaries if not present
|
||||||
function :install {
|
function :install {
|
||||||
:
|
echo $NUX_ENV_DIR
|
||||||
|
:symlink bashrc .bashrc
|
||||||
|
}
|
||||||
|
|
||||||
|
function :symlink source target {
|
||||||
|
local env=~
|
||||||
|
target=${env}/${target}
|
||||||
|
source=${NUX_ENV_DIR}/${source}
|
||||||
|
real_source=$(realpath $source)
|
||||||
|
nux.log debug "$target" is symlink to "$real_source"
|
||||||
|
if [ -e "$target" ] {
|
||||||
|
nux.log debug "$target" exists
|
||||||
|
if [ -h "$target" ] {
|
||||||
|
link_target=$(realpath $target)
|
||||||
|
if [ "$real_source" = "$link_target" ] {
|
||||||
|
nux.log debug "$target" is already symlink to $source
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
nux.log debug "$target" is symlink to "$link_target"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
##
|
||||||
## fixmes::
|
## fixmes::
|
||||||
## List all fixmes for nux-env
|
## List all fixmes for nux-env
|
||||||
function :fixmes {
|
function :fixmes {
|
||||||
|
|
@ -35,9 +59,10 @@
|
||||||
find "$NUX_INC_DIR" -iname "*.sh" | xargs fgrep -n FIXME
|
find "$NUX_INC_DIR" -iname "*.sh" | xargs fgrep -n FIXME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
## help library:: <inc>
|
## help library:: <inc>
|
||||||
## Displays help for specified nuxs-env library.
|
## Displays help for specified nuxs-env library.
|
||||||
##
|
|
||||||
function :help.library name {
|
function :help.library name {
|
||||||
nux.log debug "Library"
|
nux.log debug "Library"
|
||||||
if [ -e "$NUX_INC_DIR/$name.inc.sh" ] {
|
if [ -e "$NUX_INC_DIR/$name.inc.sh" ] {
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,9 @@ if [ -n "$NUX_SCRIPT" ]; then
|
||||||
|
|
||||||
NUX_SCRIPTNAME=$(basename "$NUX_SCRIPT")
|
NUX_SCRIPTNAME=$(basename "$NUX_SCRIPT")
|
||||||
|
|
||||||
|
NUX_APP_NAME="${NUX_APP_NAME:=$NUXR_APP_NAME}"
|
||||||
|
NUX_APP_DIR="${NUX_APP_DIR:=$NUXR_APP_DIR}"
|
||||||
|
|
||||||
nux.log trace "NUX_SCRIPT env: " $(set | grep NUX_SCRIPT)
|
nux.log trace "NUX_SCRIPT env: " $(set | grep NUX_SCRIPT)
|
||||||
if [ -z "$NUX_NO_INCLUDE" ]
|
if [ -z "$NUX_NO_INCLUDE" ]
|
||||||
then
|
then
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ nux.use taskie/backend.dir
|
||||||
|
|
||||||
function with.backend backendId {
|
function with.backend backendId {
|
||||||
backend=$(echo $backendId | cut -d: -f1);
|
backend=$(echo $backendId | cut -d: -f1);
|
||||||
nux.exec.optional backend.$backend.with;
|
nux.exec.optional backend.$backend.with "$backendId";
|
||||||
}
|
}
|
||||||
|
|
||||||
function endwith.backend {
|
function endwith.backend {
|
||||||
|
|
@ -40,6 +40,7 @@ function endwith.backend {
|
||||||
if ! backend.$backend.issue.exists "$@" ; then
|
if ! backend.$backend.issue.exists "$@" ; then
|
||||||
local labels=$(backend.$backend.labels.id)
|
local labels=$(backend.$backend.labels.id)
|
||||||
nux.log debug "Labels: $labels"
|
nux.log debug "Labels: $labels"
|
||||||
|
|
||||||
label=$(echo "$labels" | grep -G "^$1:")
|
label=$(echo "$labels" | grep -G "^$1:")
|
||||||
local labelName=""
|
local labelName=""
|
||||||
local labelId=""
|
local labelId=""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue