[scm-wrapper] Report when file wrapper did not match anything

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-04-12 13:34:41 +02:00
parent 3ac7148b38
commit 29a2b45fb4
2 changed files with 22 additions and 0 deletions

View file

@ -76,6 +76,8 @@ class FileWrapper(ScmBase):
if scm_root:
raise ValueError("FileWrapper: 'scm_root' should be empty.")
dirs = glob.glob(scm_dir)
if not dirs:
raise RuntimeError('No directories matched, can not export.')
for i in dirs:
_copy_all(i, target_dir)
@ -83,6 +85,8 @@ class FileWrapper(ScmBase):
if scm_root:
raise ValueError("FileWrapper: 'scm_root' should be empty.")
files = glob.glob(scm_file)
if not files:
raise RuntimeError('No files matched, can not export.')
for i in files:
target_path = os.path.join(target_dir, os.path.basename(i))
shutil.copy2(i, target_path)