Skip to content

Commit

Permalink
Fix install env issues
Browse files Browse the repository at this point in the history
在缺少Composer或者PHP一些文件夹不会创建的问题
  • Loading branch information
DreamMiu authored Nov 19, 2023
1 parent 41b0d6a commit 88cf2e6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ext/v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ function download_file() {
fi
_down_symbol=0
if [ ! -f "$2" ]; then
echo -ne "$(nhead) 正在下载 $1 ... "
# 获取目录路径
download_dir=$(dirname "$2")

# 检查目录是否存在,如果不存在则创建
if [ ! -d "$download_dir" ]; then
mkdir -p "$download_dir"
fi

echo -ne "$(nhead) 正在下载 $1 到目录 $download_dir ... "
$downloader "$1" -$_down_prefix "$2" >/dev/null 2>&1 && echo "完成!" && _down_symbol=1
else
echo "已存在" && _down_symbol=1
echo "文件已存在" && _down_symbol=1
fi
if [ $_down_symbol == 0 ]; then
echo "$(nhead red) 下载失败!请检查网络连接!"
Expand Down

0 comments on commit 88cf2e6

Please sign in to comment.