From d82c37a3fe28ae0bf8c5ff8607facc68bb4f6a3c Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 10 Dec 2012 18:07:03 +0000 Subject: [PATCH] * support for checking user-defined pre-condition --- website/scripts/utorrent-postprocess.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/scripts/utorrent-postprocess.groovy b/website/scripts/utorrent-postprocess.groovy index d55e9cec..6eda1f64 100644 --- a/website/scripts/utorrent-postprocess.groovy +++ b/website/scripts/utorrent-postprocess.groovy @@ -6,6 +6,11 @@ def failOnError = _args.conflict == 'fail' _args.bindings?.each{ _log.finest("Parameter: $it.key = $it.value") } args.each{ _log.finest("Argument: $it") } +// check user-defined pre-condition +if (tryQuietly{ ut_state != ut_state_allow }) { + throw new Exception("Invalid state: ut_state = $ut_state (expected $ut_state_allow)") +} + // enable/disable features as specified via --def parameters def subtitles = tryQuietly{ subtitles.toBoolean() } def artwork = tryQuietly{ artwork.toBoolean() }