From 1dbb4f4fb73ed1a3be97f87b059c8a5e1ebc9536 Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 22 Jan 2019 07:56:21 +0530 Subject: [PATCH] Adding requirements file check for python environment (#1067) * Adding check for requirements file, in case user is simply using a source file and --src flag * Adding bash check as per review comment --- environments/python/builder/defaultBuildCmd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/environments/python/builder/defaultBuildCmd b/environments/python/builder/defaultBuildCmd index e9215130..1e40ed6c 100755 --- a/environments/python/builder/defaultBuildCmd +++ b/environments/python/builder/defaultBuildCmd @@ -1,2 +1,8 @@ #!/bin/sh -pip3 install -r ${SRC_PKG}/requirements.txt -t ${SRC_PKG} && cp -r ${SRC_PKG} ${DEPLOY_PKG} \ No newline at end of file +set -euxo pipefail + +if [ -f ${SRC_PKG}/requirements.txt ] +then + pip3 install -r ${SRC_PKG}/requirements.txt -t ${SRC_PKG} +fi +cp -r ${SRC_PKG} ${DEPLOY_PKG} \ No newline at end of file