Skip to content

Commit

Permalink
fix shell check
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocazzolato committed Sep 25, 2020
1 parent 31074fb commit 5bd0667
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions tests/lib/snaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ make_snap() {
local SNAP_DIR="${2:-$TESTSLIB/snaps/${SNAP_NAME}}"
local SNAP_VERSION="${3:-1.0}"

local META_FILE="$SNAP_DIR/meta/snap.yaml"
local META_FILE META_NAME SNAP_FILE
META_FILE="$SNAP_DIR/meta/snap.yaml"
if [ ! -f "$META_FILE" ]; then
echo "snap.yaml file not found for $SNAP_NAME snap"
return 1
fi
local META_NAME="$(grep '^name:' "$META_FILE" | awk '{ print $2 }' | tr -d ' ')"
local SNAP_FILE="${SNAP_DIR}/${META_NAME}_${SNAP_VERSION}_all.snap"
META_NAME="$(grep '^name:' "$META_FILE" | awk '{ print $2 }' | tr -d ' ')"
SNAP_FILE="${SNAP_DIR}/${META_NAME}_${SNAP_VERSION}_all.snap"
# assigned in a separate step to avoid hiding a failure
if [ ! -f "$SNAP_FILE" ]; then
snap pack "$SNAP_DIR" "$SNAP_DIR" >/dev/null
Expand Down
7 changes: 4 additions & 3 deletions tests/lib/tools/snaps-state
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ pack_local() {
local SNAP_DIR="${2:-$TESTSLIB/snaps/${SNAP_NAME}}"
local SNAP_VERSION="${3:-1.0}"

local META_FILE="$SNAP_DIR/meta/snap.yaml"
local META_FILE META_NAME SNAP_FILE
META_FILE="$SNAP_DIR/meta/snap.yaml"
if [ ! -f "$META_FILE" ]; then
echo "snap.yaml file not found for $SNAP_NAME snap"
return 1
fi
local META_NAME="$(grep '^name:' "$META_FILE" | awk '{ print $2 }' | tr -d ' ')"
local SNAP_FILE="${SNAP_DIR}/${META_NAME}_${SNAP_VERSION}_all.snap"
META_NAME="$(grep '^name:' "$META_FILE" | awk '{ print $2 }' | tr -d ' ')"
SNAP_FILE="${SNAP_DIR}/${META_NAME}_${SNAP_VERSION}_all.snap"
# assigned in a separate step to avoid hiding a failure
if [ ! -f "$SNAP_FILE" ]; then
snap pack "$SNAP_DIR" "$SNAP_DIR" >/dev/null
Expand Down

0 comments on commit 5bd0667

Please sign in to comment.