From 02629feb19f540476b3b93bfb4f07cd5fab95583 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauld.mccarthy@gmail.com>
Date: Thu, 17 Nov 2016 18:08:47 +0000
Subject: [PATCH] imcp fail if source doesn't exist

---
 fsl/utils/imcp.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fsl/utils/imcp.py b/fsl/utils/imcp.py
index 47a509025..b39b75375 100644
--- a/fsl/utils/imcp.py
+++ b/fsl/utils/imcp.py
@@ -75,6 +75,10 @@ def imcp(src,
         # again to get its extension
         srcBase, srcExt = fslimage.splitExt(src)
 
+    if not op.exists(src):
+        raise fslpath.PathError('imcp error - source path '
+                                'does not exist: {}'.format(src))
+
     # Figure out the destination file
     # extension/type. If useDefaultExt
     # is True, we use the default
-- 
GitLab