arch-chroot: split variable declaration and assignment
As suggested by shellcheck: In arch-chroot line 164: local src=$(resolve_link /etc/resolv.conf) ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In arch-chroot line 165: local dest=$(resolve_link "$chrootdir/etc/resolv.conf" "$chrootdir") ^--^ SC2155 (warning): Declare and assign separately to avoid masking return values. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
parent
45a2073e33
commit
abef18a432
@ -47,8 +47,11 @@ resolve_link() {
|
|||||||
|
|
||||||
chroot_add_resolv_conf() {
|
chroot_add_resolv_conf() {
|
||||||
local chrootdir=$1
|
local chrootdir=$1
|
||||||
local src=$(resolve_link /etc/resolv.conf)
|
local src
|
||||||
local dest=$(resolve_link "$chrootdir/etc/resolv.conf" "$chrootdir")
|
local dest
|
||||||
|
|
||||||
|
src=$(resolve_link /etc/resolv.conf)
|
||||||
|
dest=$(resolve_link "$chrootdir/etc/resolv.conf" "$chrootdir")
|
||||||
|
|
||||||
# If we don't have a source resolv.conf file, there's nothing useful we can do.
|
# If we don't have a source resolv.conf file, there's nothing useful we can do.
|
||||||
[[ -e $src ]] || return 0
|
[[ -e $src ]] || return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user