Skip to content

Commit

Permalink
Merge pull request #51 from ergochat/comments
Browse files Browse the repository at this point in the history
fix #46
  • Loading branch information
slingamn authored Jul 14, 2024
2 parents 7f70307 + ed3246a commit 71e3129
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ func ReadScript(filename string) (commands []string, err error) {
reader := bufio.NewReader(infile)
for {
line, err := reader.ReadString('\n')
if command := strings.TrimRight(line, "\r\n"); command != "" {
command := strings.TrimRight(line, "\r\n")
command = strings.TrimLeft(command, " \t\v\r")
if command != "" && !strings.HasPrefix(command, "#") {
commands = append(commands, command)
}
if err == io.EOF {
Expand Down

0 comments on commit 71e3129

Please sign in to comment.