Skip to content

Commit

Permalink
adding support for rye-file uri for append-to-file
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikmota committed Oct 8, 2024
1 parent f59a67e commit e5831e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion evaldo/builtins_pipes.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,14 @@ var Builtins_pipes = map[string]*env.Builtin{
return *env.NewError("Error while appending data to files.")
}
return *env.NewInteger(writtenBytes)
case env.Uri:
writtenBytes, err := pipe.AppendFile(s.Path)
if err != nil {
return *env.NewError("Error while appending data to rey-file.")
}
return *env.NewInteger(writtenBytes)
default:
return MakeArgError(ps, 2, []env.Type{env.StringType}, "p-append-to-file")
return MakeArgError(ps, 2, []env.Type{env.StringType, env.UriType}, "p-append-to-file")
}
default:
return MakeNativeArgError(ps, 1, []string{"script-pipe"}, "p-append-to-file")
Expand Down

0 comments on commit e5831e5

Please sign in to comment.