From 97609a0a45c6f7428da0da3697178784aaabf991 Mon Sep 17 00:00:00 2001 From: debuggerx Date: Wed, 17 Mar 2021 00:20:03 +0800 Subject: [PATCH] feat: throw error when pass undefined flavor name. --- bin/pre_script.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/pre_script.dart b/bin/pre_script.dart index 8542efc..bfaabf1 100644 --- a/bin/pre_script.dart +++ b/bin/pre_script.dart @@ -34,6 +34,9 @@ void main(List arguments) { flavor = args.flavor; isReplace = args.isReplaceMode; + if (!FLAVORS.contains(flavor)) + throw Exception('Undefined flavor !!!'); + _ctx.addEntries(FLAVORS.map((e) => MapEntry(e, e))); _ctx.addAll({