2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-07 03:22:03 +00:00

Compare commits

..

No commits in common. "682794046626c152efb614fd55ab75b6e0272d54" and "60edfc00ee77a0e193ae4228786d72e82a79dd32" have entirely different histories.

3 changed files with 1 additions and 9 deletions

View File

@ -8,7 +8,6 @@
### Fixed ### Fixed
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else) - Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)
- Apply environment variables properly after 2.3 shell interpreter changes - Apply environment variables properly after 2.3 shell interpreter changes
- hilbish.sink.readAll() function now reads data that doesn't end in a newline
## [2.3.3] - 2024-11-04 ## [2.3.3] - 2024-11-04
### Fixed ### Fixed

View File

@ -44,7 +44,7 @@ function hilbish.run(cmd, streams)
end end
local out = hilbish.snail:run(cmd, {sinks = sinks}) local out = hilbish.snail:run(cmd, {sinks = sinks})
local returns = {out.exitCode} local returns = {out}
if type(streams) == 'boolean' and not streams then if type(streams) == 'boolean' and not streams then
table.insert(returns, sinks.out:readAll()) table.insert(returns, sinks.out:readAll())

View File

@ -94,17 +94,11 @@ func luaSinkReadAll(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return nil, err return nil, err
} }
if s.autoFlush {
s.Rw.Flush()
}
lines := []string{} lines := []string{}
for { for {
line, err := s.Rw.ReadString('\n') line, err := s.Rw.ReadString('\n')
if err != nil { if err != nil {
if err == io.EOF { if err == io.EOF {
// We still want to add the data we read
lines = append(lines, line)
break break
} }
@ -233,7 +227,6 @@ func luaSinkAutoFlush(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
func NewSink(rtm *rt.Runtime, Rw io.ReadWriter) *Sink { func NewSink(rtm *rt.Runtime, Rw io.ReadWriter) *Sink {
s := &Sink{ s := &Sink{
Rw: bufio.NewReadWriter(bufio.NewReader(Rw), bufio.NewWriter(Rw)), Rw: bufio.NewReadWriter(bufio.NewReader(Rw), bufio.NewWriter(Rw)),
autoFlush: true,
} }
s.UserData = sinkUserData(rtm, s) s.UserData = sinkUserData(rtm, s)