mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-05 10:32:03 +00:00
Compare commits
5 Commits
60edfc00ee
...
6827940466
Author | SHA1 | Date | |
---|---|---|---|
6827940466 | |||
fde615ff3f | |||
d002c82271 | |||
f64229b52c | |||
|
3d5766ac33 |
@ -8,6 +8,7 @@
|
|||||||
### 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
|
||||||
|
@ -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}
|
local returns = {out.exitCode}
|
||||||
|
|
||||||
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())
|
||||||
|
@ -94,11 +94,17 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,6 +233,7 @@ 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)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user