1 Star 1 Fork 23

李帅/openharmony_oneclick_env_init

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install_ninja.sh 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
mamingshuai 提交于 2021-07-31 14:49 . 增加获取系统版本脚本
#!/bin/bash
baseDirForScriptSelf=$(cd "$(dirname "$0")"; pwd)
source ${baseDirForScriptSelf}/source.sh
# 安装ninja
source ${baseDirForScriptSelf}/proxy.sh
DownLoad_URL=https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar
file_name=`basename ${DownLoad_URL}`
cd ${work_dir}
if [ ! -f "${work_dir}/${file_name}" ];then
wget –-no-check-certificate "${DownLoad_URL}" >>${baseDirForScriptSelf}/init_run.log 2>&1
check_line=$((LINENO-1))
if [ $? -gt 0 ];then
push_error "${check_line}" "ninja download failed,please check!" "1"
else
check_sha256 "${DownLoad_URL}" "${work_dir}/${file_name}"
fi
fi
if [ -d ~/ninja ];then
mv ~/ninja ~/ninja_bak_${unix_time}
fi
mkdir ~/ninja
tar -xvf ${work_dir}/${file_name} -C ~/ninja >>${baseDirForScriptSelf}/init_run.log 2>&1
BIN_FILE=`find ~/ninja -maxdepth 3 -type f -name 'ninja'`
BIN_PATH=`dirname ${BIN_FILE}`
sudo bash -c "echo 'export PATH=${BIN_PATH}:\$PATH'>/etc/profile.d/ninja.sh"
source /etc/profile
source /etc/profile.d/ninja.sh
ninja_version=`ninja --version`
if [ $? -gt 0 ];then
echo -e "${failed_color},ninja install failed.Please check!"
exit 1
else
echo -e "${success_color},ninja install success.version:${ninja_version}"
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/code_fighter/openharmony_oneclick_env_init.git
git@gitee.com:code_fighter/openharmony_oneclick_env_init.git
code_fighter
openharmony_oneclick_env_init
openharmony_oneclick_env_init
master

搜索帮助