1 Star 0 Fork 23

zhangjian22/openharmony_oneclick_env_init

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install_hb.sh 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
mamingshuai 提交于 2022-01-30 07:32 . update install_hb.sh.
#!/bin/bash
# 安装hb
baseDirForScriptSelf=$(cd "$(dirname "$0")"; pwd)
source ${baseDirForScriptSelf}/source.sh
cd ${work_dir}/OpenHarmony
unset http_proxy
unset https_proxy
is_huawei_tmp=`curl -I -m 10 -o /dev/null -s -w %{http_code} w3.huawei.com`
if [ "${is_huawei_tmp}" == "200" ];then
is_huawei=true
else
is_huawei=false
fi
## 内网不需要配置代理
if [ "${is_huawei}" == "true" ];then
unset http_proxy;unset https_proxy
else
source ${baseDirForScriptSelf}/proxy.sh
fi
python3.8 -m pip install --user --upgrade ohos-build >>${baseDirForScriptSelf}/init_run.log 2>&1
if [ ! -d ~/.local/ ];then
echo -e "${failed_color},hb install failed,dir '~/.local/' not exist,Please check!"
else
BIN_PATH=~/.local/bin
sudo bash -c "echo 'export PATH=~/.local/bin:\$PATH' >/etc/profile.d/hb.sh"
source /etc/profile
source /etc/profile.d/hb.sh
fi
hb_version=`hb --version`
if [ $? -gt 0 ];then
echo -e "${failed_color},hb install failed.Please check!"
exit 1
else
echo -e "${success_color},hb install success.version:${hb_version}"
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jakemiao/openharmony_oneclick_env_init.git
git@gitee.com:jakemiao/openharmony_oneclick_env_init.git
jakemiao
openharmony_oneclick_env_init
openharmony_oneclick_env_init
master

搜索帮助