Skip to content

Releases: mvdan/sh

v3.4.0

01 Oct 22:05
Compare
Choose a tag to compare

This release drops support for Go 1.15, which allows the code to start benefitting from io/fs.

  • cmd/shfmt
    • Walks directories ~10% faster thanks to filepath.WalkDir
  • syntax
    • Add Quote to mirror strconv.Quote for shell syntax
    • Skip null characters when parsing, just like Bash
    • Rewrite fuzzers with Go 1.18's native fuzzing
  • fileutil
    • Add CouldBeScript2 using io/fs.DirEntry
  • expand
    • Skip or stop at null characters, just like Bash
  • interp
    • Set GID just like UID
    • Add support for read -p
    • Add support for pwd flags
    • Create random FIFOs for process substitutions more robustly
    • Avoid leaking an open file when interpreting $(<file)

Binaries built on go version go1.17.1 linux/amd64 via a shell script.

Consider becoming a sponsor if you benefit from the work that went into this release!

v3.3.1

01 Aug 16:48
Compare
Choose a tag to compare

Highlights:

  • syntax
    • Don't convert & in a separate line into ;
    • Fix a BinaryNextLine edge case idempotency bug
    • Never start printing a command with an escaped newline
  • interp
    • Support calling Runner.Reset before Runner.Run
    • Obey set -e for failed redirections

Binaries built on go version go1.16.6 linux/amd64 via a shell script.

Consider becoming a sponsor if you benefit from the work that went into this release!

v3.3.0

17 May 14:18
Compare
Choose a tag to compare

Highlights:

  • cmd/shfmt
    • Document the FORCE_COLOR env var to always use colors in diffs
  • syntax
    • Add the printer SingleLine option to avoid printing newlines
    • Positions now use more bits for line numbers than column numbers
    • Test operators like && and || no longer escape newlines
    • Properly handle closing backquotes in a few edge cases
    • Properly handle trailing escaped newlines in heredocs
  • interp
    • Redesigned variable scoping to fix a number of edge cases
    • Refactor set -o nounset support to fix many edge cases
    • Deprecate LookPath in favor of LookPathDir
    • Array element words are now expanded correctly
    • Add support for trap with error and exit signals
    • Add support for shopt -s nullglob
    • Add support for type -p

Binaries built on go version go1.16.4 linux/amd64 via a shell script.

Consider becoming a sponsor if you benefit from the work that went into this release!

v3.2.4

08 Mar 12:07
Compare
Choose a tag to compare

Highlights:

  • cmd/shfmt
    • Don't stop handling arguments when one results in a failure
  • expand
    • Don't panic when a backslash is followed by EOF

Binaries built on go version go1.16 linux/amd64 via a shell script.

Consider becoming a sponsor if you benefit from the work that went into this release!

v3.2.2

29 Jan 14:26
Compare
Choose a tag to compare

Highlights:

  • syntax
    • Avoid comment position panic in the printer

Binaries built on go version go1.15.7 linux/amd64 via a shell script.

Consider becoming a sponsor if you benefit from the work that went into this release!

v3.2.1

02 Dec 18:39
Compare
Choose a tag to compare

Highlights:

  • syntax
    • Fix an endless loop when parsing single quotes in parameter expansions
    • Properly print assignments using escaped newlines
    • Print inline heredoc comments in the right place
  • interp
    • Always expand ~ in Bash test expressions
  • expand
    • Don't panic on out of bounds array index expansions

Binaries built on go version go1.15.5 linux/amd64 via a shell script.

Consider becoming a sponsor if you benefit from the work that went into this release!

v3.2.0

30 Oct 15:18
Compare
Choose a tag to compare

Highlights:

  • cmd/shfmt
    • Add a man page via scdoc; see shfmt.1.scd
    • Add -filename to give a name to standard input
  • syntax
    • Add initial support for Bats
    • Protect line and column position numbers against overflows
    • Rewrite arithmetic parsing to fix operator precedence
    • Don't add parentheses to function f {...} declarations for ksh support
    • KeepPadding now obeys extra indentation when using space indentation
    • Properly tokenize (( within test expressions
    • Properly tokenize single quotes within parameter expansions
    • Obey print options inside <<- heredocs
    • Don't simplify indexed parameter expansions in arithmetic expressions
    • Improve parsing errors for missing test expressions
    • LangVariant now implements flag.Value
  • interp
    • Avoid panic on C-style loops which omit expressions
    • $@ and $* always exist, so "$@" can expand to zero words

Binaries built on go version go1.15.3 linux/amd64 via a shell script.

Consider becoming a sponsor if you benefit from the work that went into this release!

v3.1.2

26 Jun 12:30
Compare
Choose a tag to compare

Highlights:

  • syntax
    • Fix brace indentation when using FunctionNextLine
    • Support indirect parameter expansions with transformations
    • Stop heredoc bodies only when the entire line matches
  • interp
    • Make the tests pass on 32-bit platforms

Binaries built on go version go1.14.4 linux/amd64.

v3.1.1

04 May 21:31
Compare
Choose a tag to compare

Highlights:

  • cmd/shfmt
    • Recognise function_next_line in EditorConfig files
  • syntax
    • Don't ignore escaped newlines at the end of heredoc bodies
    • Improve support for parsing regexes in test expressions
    • Count columns for KeepPadding in bytes, to better support unicode
    • Never let KeepPadding add spaces right after indentation
  • interp
    • Hide unset variables when executing programs

Binaries built on go version go1.14.2 linux/amd64.

v3.1.0

07 Apr 11:36
Compare
Choose a tag to compare

Highlights:

  • Redesigned Docker images, including buildx and an Alpine variant
  • cmd/shfmt
    • Replace source files atomically when possible
    • Support ignore = true in an EditorConfig to skip directories
    • Add -fn to place function opening braces on the next line
    • Improve behavior of -f when given non-directories
    • Docker images and go get installs now embed good version information
  • syntax
    • Add support for nested here-documents
    • Allow parsing for loops with braces, present in mksh and Bash
    • Expand CaseClause to describe its in token
    • Allow empty lines in Bash arrays in the printer
    • Support disabling KeepPadding
    • Avoid mis-printing some programs involving &
  • interp
    • Add initial support for Bash process substitutions
    • Add initial support for aliases
    • Fix an edge case where the status code would not be reset
    • The exit status code can now reflect being stopped by a signal
    • test -t now uses the interpreter's stdin/stdout/stderr files
  • expand
    • Improve the interaction of @ and * with quotes and IFS

Binaries built on go version go1.14.2 linux/amd64.

Please note that the binaries were re-uploaded on April 10th, to update the Go version and fix the missing version information.