mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 19:49:45 +01:00
home-manager: add shellcheck directives
This commit is contained in:
parent
a9dc7fa7cc
commit
5fe8d574ca
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,7 @@ PATH=@coreutils@/bin:@less@/bin${PATH:+:}$PATH
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
function errorEcho() {
|
function errorEcho() {
|
||||||
|
# shellcheck disable=2048,2086
|
||||||
echo $* >&2
|
echo $* >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +68,7 @@ function doBuildAttr() {
|
||||||
extraArgs="$extraArgs --show-trace"
|
extraArgs="$extraArgs --show-trace"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=2086
|
||||||
nix-build \
|
nix-build \
|
||||||
"<home-manager/home-manager/home-manager.nix>" \
|
"<home-manager/home-manager/home-manager.nix>" \
|
||||||
$extraArgs \
|
$extraArgs \
|
||||||
|
@ -82,6 +84,7 @@ function presentNews() {
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. "$infoFile"
|
. "$infoFile"
|
||||||
|
|
||||||
|
# shellcheck disable=2154
|
||||||
if [[ $newsNumUnread -eq 0 ]]; then
|
if [[ $newsNumUnread -eq 0 ]]; then
|
||||||
return
|
return
|
||||||
elif [[ "$newsDisplay" == "silent" ]]; then
|
elif [[ "$newsDisplay" == "silent" ]]; then
|
||||||
|
@ -157,6 +160,7 @@ function doSwitch() {
|
||||||
|
|
||||||
function doListGens() {
|
function doListGens() {
|
||||||
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
|
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
|
||||||
|
# shellcheck disable=2012
|
||||||
ls --color=yes -gG --time-style=long-iso --sort time home-manager-*-link \
|
ls --color=yes -gG --time-style=long-iso --sort time home-manager-*-link \
|
||||||
| cut -d' ' -f 4- \
|
| cut -d' ' -f 4- \
|
||||||
| sed -E 's/home-manager-([[:digit:]]*)-link/: id \1/'
|
| sed -E 's/home-manager-([[:digit:]]*)-link/: id \1/'
|
||||||
|
@ -241,6 +245,7 @@ function doShowNews() {
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. "$infoFile"
|
. "$infoFile"
|
||||||
|
|
||||||
|
# shellcheck disable=2154
|
||||||
case $1 in
|
case $1 in
|
||||||
--all)
|
--all)
|
||||||
${PAGER:-less} "$newsFileAll"
|
${PAGER:-less} "$newsFileAll"
|
||||||
|
@ -253,6 +258,7 @@ function doShowNews() {
|
||||||
return 1
|
return 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# shellcheck disable=2154
|
||||||
if [[ -s "$newsUnreadIdsFile" ]]; then
|
if [[ -s "$newsUnreadIdsFile" ]]; then
|
||||||
local newsReadIdsFile
|
local newsReadIdsFile
|
||||||
newsReadIdsFile="$(newsReadIdsFile)"
|
newsReadIdsFile="$(newsReadIdsFile)"
|
||||||
|
|
Loading…
Reference in a new issue