From fd78cdce24bc9592d9f66851b569813da926b8d0 Mon Sep 17 00:00:00 2001 From: azhengzz <820108271@qq.com> Date: Fri, 19 Feb 2021 17:58:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ELinux=20Shell=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=EF=BC=8C=E7=94=A8=E4=BA=8E=E5=AF=BC=E5=87=BA=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E9=A1=B9=E7=9B=AE=E7=8E=AF=E5=A2=83=E4=B8=AD=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E6=96=B9=E5=BA=93=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApiAutomationTest/export_package_info.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ApiAutomationTest/export_package_info.sh diff --git a/ApiAutomationTest/export_package_info.sh b/ApiAutomationTest/export_package_info.sh new file mode 100644 index 0000000..c714233 --- /dev/null +++ b/ApiAutomationTest/export_package_info.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo "**********************************************************************" +echo "***********************【导出Python环境包信息】***********************" +pip=`pwd`/venv/bin/pip +pipdeptree=`pwd`/venv/bin/pipdeptree + +if [ -e $pip ] +then + echo "***********************【检测到项目目录下Python解释器】***************" + echo "# 项目目录下Python第三方package信息" > `pwd`/package_info.txt + $pip freeze >> `pwd`/package_info.txt + echo "# 项目目录下Python第三方package依赖树信息" > `pwd`/package_deptree_info.txt + $pipdeptree -a >> `pwd`/package_deptree_info.txt +else + echo "***********************【未检测到项目目录下Python解释器,使用系统环境变量目录下Python解释器】************" + echo "# 系统环境变量中Python第三方package信息" > `pwd`/package_info.txt + pip freeze >> `pwd`/package_info.txt + echo "# 系统环境变量中Python第三方package依赖树信息" > `pwd`/package_deptree_info.txt + pipdeptree -a >> `pwd`/package_deptree_info.txt +fi + +echo "***********************【导出Python包信息完成】***********************"