Files
snapd/tests/lib/changes.sh
Maciej Borzecki 11c4c6e2f5 many: assorted shellcheck fixes
run-checks --static will run shellcheck only if one is installed in the system,
which is not the case when it's called in spread tests. As a result quite a lot
of issues got their way into the code unnoticed.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2018-07-03 16:41:00 +02:00

9 lines
188 B
Bash
Executable File

#!/bin/bash
change_id() {
# takes <summary pattern> [<status>]
local SUMMARY_PAT=$1
local STATUS=${2:-}
snap changes|grep -o -P "^\\d+(?= *${STATUS}.*${SUMMARY_PAT}.*)"
}