aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/project/utils.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-03-30 11:56:05 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-03-30 12:03:37 +0300
commit98e3a56296cb9955e49adb09a111f26e07328338 (patch)
treebbbd6a464a809c00398bc12ef4cb472f92b30eab /project/utils.py
parentproject.cmake: make it --boost aware (diff)
downloadcmake-common-98e3a56296cb9955e49adb09a111f26e07328338.tar.gz
cmake-common-98e3a56296cb9955e49adb09a111f26e07328338.zip
project.ci: dedupe code
Diffstat (limited to 'project/utils.py')
-rw-r--r--project/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/project/utils.py b/project/utils.py
index 68327af..5874eab 100644
--- a/project/utils.py
+++ b/project/utils.py
@@ -74,3 +74,9 @@ def temp_file(contents, **kwargs):
file.write(contents)
with delete(path):
yield path
+
+
+def env(name):
+ if name not in os.environ:
+ raise RuntimeError(f'undefined environment variable: {name}')
+ return os.environ[name]