Skip to content

Files

Latest commit

 

History

History
28 lines (17 loc) · 661 Bytes

SC1090.md

File metadata and controls

28 lines (17 loc) · 661 Bytes

Pattern: Can't follow non-constant source

Issue: -

Description

ShellCheck is not able to include sourced files from paths that are determined at runtime. The file will not be read, potentially resulting in warnings about unassigned variables and similar.

Example of incorrect code:

. "$(find_install_dir)/lib.sh"

Example of correct code:

# shellcheck source=src/lib.sh
. "$(find_install_dir)/lib.sh"

Exceptions

If you don't care that ShellCheck is unable to account for the file, specify # shellcheck source=/dev/null.

Further Reading