api-automation-test/ApiAutomationTest/export_package_info.sh

24 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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包信息完成】***********************"