-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC1090
Dale Wijnand edited this page Oct 17, 2019
·
9 revisions
. "$(find_install_dir)/lib.sh"
# shellcheck source=src/lib.sh
. "$(find_install_dir)/lib.sh"
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.
Use a Directive to point shellcheck to a fixed location it can read instead.
If you don't care that ShellCheck is unable to account for the file, specify # shellcheck source=/dev/null
.
shellcheck -P dir1:dir2/libs
Specify paths to search for sourced files, separated by :
on Unix and ;
on Windows. Absolute paths will also be rooted in these.
The special path SCRIPTDIR
can be used to specify searching the currently checked script's directory, as in -P SCRIPTDIR
or -P SCRIPTDIR/../libs
. Subsequent -P
flags accumulate and take precedence.