Travis: Point shellcheck to config files
This commit is contained in:
parent
bb2b7ab544
commit
4d36341475
2 changed files with 7 additions and 1 deletions
|
@ -19,3 +19,4 @@ before_install:
|
||||||
script:
|
script:
|
||||||
- time ./neofetch --ascii --config travis --ascii_distro travis -v
|
- time ./neofetch --ascii --config travis --ascii_distro travis -v
|
||||||
- bash -c 'shellcheck neofetch'
|
- bash -c 'shellcheck neofetch'
|
||||||
|
|
||||||
|
|
7
neofetch
7
neofetch
|
@ -88,6 +88,7 @@ get_distro() {
|
||||||
else
|
else
|
||||||
# Source the os-release file
|
# Source the os-release file
|
||||||
for file in /etc/os-release /usr/lib/os-release /etc/*release /usr/lib/*release; do
|
for file in /etc/os-release /usr/lib/os-release /etc/*release /usr/lib/*release; do
|
||||||
|
# shellcheck source=/etc/os-release
|
||||||
source "$file" && break
|
source "$file" && break
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -2414,6 +2415,7 @@ info() {
|
||||||
|
|
||||||
# Use cache if it exists
|
# Use cache if it exists
|
||||||
if [[ -f "${cache_dir}/neofetch/${2}" ]]; then
|
if [[ -f "${cache_dir}/neofetch/${2}" ]]; then
|
||||||
|
# shellcheck source=/dev/null
|
||||||
source "${cache_dir}/neofetch/${2}"
|
source "${cache_dir}/neofetch/${2}"
|
||||||
else
|
else
|
||||||
# Call the function.
|
# Call the function.
|
||||||
|
@ -2817,6 +2819,7 @@ get_default_config() {
|
||||||
travis_config="${script_dir}/config/travis"
|
travis_config="${script_dir}/config/travis"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck source=config/config
|
||||||
if source "$default_config"; then
|
if source "$default_config"; then
|
||||||
err "Config: Sourced default config. ($default_config)"
|
err "Config: Sourced default config. ($default_config)"
|
||||||
else
|
else
|
||||||
|
@ -2827,11 +2830,13 @@ get_default_config() {
|
||||||
get_user_config() {
|
get_user_config() {
|
||||||
# Check $config_file
|
# Check $config_file
|
||||||
if [[ -f "$config_file" ]]; then
|
if [[ -f "$config_file" ]]; then
|
||||||
|
# shellcheck source=config/config
|
||||||
source "$config_file"
|
source "$config_file"
|
||||||
err "Config: Sourced user config. ($config_file)"
|
err "Config: Sourced user config. ($config_file)"
|
||||||
return
|
return
|
||||||
|
|
||||||
elif [[ "$config_file" == "travis" ]]; then
|
elif [[ "$config_file" == "travis" ]]; then
|
||||||
|
# shellcheck source=config/travis
|
||||||
source "$travis_config"
|
source "$travis_config"
|
||||||
err "Config: Sourced user config. ($travis_config)"
|
err "Config: Sourced user config. ($travis_config)"
|
||||||
return
|
return
|
||||||
|
@ -2857,7 +2862,7 @@ get_user_config() {
|
||||||
cp "$script_dir/config/config" "$XDG_CONFIG_HOME/neofetch"
|
cp "$script_dir/config/config" "$XDG_CONFIG_HOME/neofetch"
|
||||||
config_file="$XDG_CONFIG_HOME/neofetch/config"
|
config_file="$XDG_CONFIG_HOME/neofetch/config"
|
||||||
fi
|
fi
|
||||||
|
# shellcheck source=config/config
|
||||||
source "$config_file"
|
source "$config_file"
|
||||||
err "Config: Sourced user config. ($config_file)"
|
err "Config: Sourced user config. ($config_file)"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue