From cbcb5d3ed80278e202ddf5fed31cc4f320b6c703 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Tue, 10 Apr 2018 10:09:26 -0500 Subject: [PATCH] live-build/functions: reduce scope of snap account variable * Only shell out to set $account when we need to use it. * Reduce scope of $account to make it local to the function * Fix indenting within an 'if' block --- live-build/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/live-build/functions b/live-build/functions index 5af5c293..6f97592d 100644 --- a/live-build/functions +++ b/live-build/functions @@ -425,11 +425,11 @@ snap_prepare() { > "$account_key_assertion" fi - account=$(sed -n -e's/account-id: //p' < "$account_key_assertion") if ! [ -e "$account_assertion" ] ; then - snap known --remote account account-id=$account \ - > "$account_assertion" + local account=$(sed -n -e's/account-id: //p' < "$account_key_assertion") + snap known --remote account account-id=$account \ + > "$account_assertion" fi # Download the core snap