Skip to content

Commit 5b6b9fa

Browse files
committed
Warn/exit when no jar files found
1 parent 93403a9 commit 5b6b9fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

phoebus-product/create_settings_template.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import zipfile
44
import os
55
import shutil
6+
import sys
67

78

89
def create_settings_template(product_location: str, include_comments: bool, verbose: bool) -> None:
@@ -15,6 +16,10 @@ def create_settings_template(product_location: str, include_comments: bool, verb
1516
"""
1617
# find all jar files so we can unzip jar and find preference files
1718
jar_file_list = glob.glob(product_location + "/*.jar")
19+
if len(jar_file_list) <= 0:
20+
sys.stderr.write("No *.jar files found in '{}'\n".format(product_location))
21+
sys.stderr.write("Need to build sources?\n")
22+
sys.exit(-1)
1823

1924
# temp directory to hold unzipped jar file contents (deleted at end of script)
2025
tmp_zip_dir = "./tmp-zip"

0 commit comments

Comments
 (0)