Browse Source

bugfix ../, and runx

master
Julian Noble 2 years ago
parent
commit
03f081a6bb
  1. 6
      src/modules/punk-0.1.tm
  2. 12
      src/modules/shellrun-0.1.tm

6
src/modules/punk-0.1.tm

@ -351,8 +351,8 @@ namespace eval punk {
return $result return $result
} else { } else {
set a1 [lindex $args 0] set a1 [lindex $args 0]
if {$a1 in [list . ..]} { if {$a1 in [list . .. "./" "../"]} {
if {$a1 eq ".."} { if {$a1 in [list ".." "../"]} {
cd $a1 cd $a1
} }
tailcall punk::./ {*}[lrange $args 1 end] tailcall punk::./ {*}[lrange $args 1 end]
@ -379,7 +379,7 @@ namespace eval punk {
} }
} }
proc ../ {args} { proc ../ {args} {
set ::punk::last_run_display set ::punk::last_run_display [list]
if {![llength $args]} { if {![llength $args]} {
cd .. cd ..
} else { } else {

12
src/modules/shellrun-0.1.tm

@ -142,7 +142,7 @@ namespace eval shellrun {
} else { } else {
set e $::shellrun::runerr set e $::shellrun::runerr
} }
append chunk "$e\n" append chunk "[a+ red light]$e[a+]\n"
} }
lappend chunklist [list stderr $chunk] lappend chunklist [list stderr $chunk]
@ -246,7 +246,7 @@ namespace eval shellrun {
} else { } else {
set o $::shellrun::runout set o $::shellrun::runout
} }
append chunk "$o\n" ;#this newline is the display output separator - always there whether data has trailing newline or not. append chunk "[a+ white light]$o[a+]\n" ;#this newline is the display output separator - always there whether data has trailing newline or not.
} }
lappend chunklist [list stdout $chunk] lappend chunklist [list stdout $chunk]
@ -327,6 +327,10 @@ namespace eval shellrun {
flush stderr flush stderr
flush stdout flush stdout
if {[dict exists $exitinfo error]} {
#todo - check errorInfo makes sense.. return -code? tailcall?
error [dict get $exitinfo error]
}
#set x [shellfilter::stack::add stdout var -action sink-locked -settings {-varname ::repl::runxoutput}] #set x [shellfilter::stack::add stdout var -action sink-locked -settings {-varname ::repl::runxoutput}]
set chunklist [list] set chunklist [list]
@ -365,10 +369,6 @@ namespace eval shellrun {
#return [lindex [list [list stdout $::runout stderr $::runerr {*}$exitinfo] [shellfilter::stack::remove stdout $x][puts -nonewline stdout $pretty][set ::repl::output ""]] 0] #return [lindex [list [list stdout $::runout stderr $::runerr {*}$exitinfo] [shellfilter::stack::remove stdout $x][puts -nonewline stdout $pretty][set ::repl::output ""]] 0]
if {[dict exists $exitinfo error]} {
#todo - check errorInfo makes sense.. return -code? tailcall?
error [dict get $exitinfo error]
}
if {$nonewline} { if {$nonewline} {
return [list stdout [string trimright $::shellrun::runout \r\n] stderr [string trimright $::shellrun::runerr \r\n] {*}$exitinfo] return [list stdout [string trimright $::shellrun::runout \r\n] stderr [string trimright $::shellrun::runerr \r\n] {*}$exitinfo]
} }

Loading…
Cancel
Save