Fix SC2155 (directly export computed variables)
This commit is contained in:
parent
a0db375f91
commit
bcd7fbbcc4
1 changed files with 7 additions and 6 deletions
|
@ -19,9 +19,9 @@
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
export key="$(cat "$__object/parameter/key" 2>/dev/null \
|
key="$(cat "$__object/parameter/key" 2>/dev/null \
|
||||||
|| echo "$__object_id")"
|
|| echo "$__object_id")"
|
||||||
export state="$(cat "$__object/parameter/state")"
|
state="$(cat "$__object/parameter/state")"
|
||||||
|
|
||||||
file="$(cat "$__object/parameter/file")"
|
file="$(cat "$__object/parameter/file")"
|
||||||
|
|
||||||
|
@ -30,14 +30,15 @@ if [ ! -f "$file" ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export delimiter="$(cat "$__object/parameter/delimiter")"
|
delimiter="$(cat "$__object/parameter/delimiter")"
|
||||||
export value="$(cat "$__object/parameter/value" 2>/dev/null \
|
value="$(cat "$__object/parameter/value" 2>/dev/null \
|
||||||
|| echo "__CDIST_NOTSET__")"
|
|| echo "__CDIST_NOTSET__")"
|
||||||
if [ -f "$__object/parameter/exact_delimiter" ]; then
|
if [ -f "$__object/parameter/exact_delimiter" ]; then
|
||||||
export exact_delimiter=1
|
exact_delimiter=1
|
||||||
else
|
else
|
||||||
export exact_delimiter=0
|
exact_delimiter=0
|
||||||
fi
|
fi
|
||||||
|
export key state delimiter value exact_delimiter
|
||||||
|
|
||||||
awk -f - "$file" <<"AWK_EOF"
|
awk -f - "$file" <<"AWK_EOF"
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
|
Loading…
Reference in a new issue