From a79ea35d29cc873c6dfa24b794089d7199fb24e0 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Sun, 23 Jan 2022 22:13:45 +0000
Subject: [PATCH] Run npdet_info in bash subshell

---
 containers/jug/setup_detectors.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/containers/jug/setup_detectors.py b/containers/jug/setup_detectors.py
index 34caaf835..5c25a35e7 100755
--- a/containers/jug/setup_detectors.py
+++ b/containers/jug/setup_detectors.py
@@ -150,12 +150,12 @@ if __name__ == '__main__':
                           file=f)
                 ## run once inside global prefix to initialize artifacts in /opt/detectors
                 os.environ['DETECTOR_PATH'] = args.prefix
-                cmd = f'cd {args.prefix} && npdet_info print world_z {prefix}/share/athena/athena.xml'
+                cmd = f'bash -c \'cd {args.prefix} && source {prefix}/setup.sh && npdet_info print world_z {prefix}/share/athena/athena.xml\''
                 print(cmd)
                 os.system(cmd)
                 ## run once inside specific prefix to initialize artifacts in $DETECTOR_PATH
                 os.environ['DETECTOR_PATH'] = args.prefix
-                cmd = f'cd {prefix} && npdet_info print world_z {prefix}/share/athena/athena.xml'
+                cmd = f'bash -c \'cd {prefix} && source {prefix}/setup.sh && npdet_info print world_z {prefix}/share/athena/athena.xml\''
                 print(cmd)
                 os.system(cmd)
     print(' --> Symlinking default detector for backward compatibility')
-- 
GitLab