1 Star 0 Fork 0

openrc/rc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
install.sh 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
root 提交于 2022-07-22 12:13 . update docker
#!/bin/bash
set -euo pipefail
TOPDIR=$(dirname $0)
MYBASHRC=~/.mybashrc
has() {
type "$1" >/dev/null 2>&1
}
install_git()
{
has git && return 0
sudo yum install -y git
git clone https://github.com/lintingzhen/commitizen-go.git && cd commitizen-go
make && make install
echo 'source /usr/share/doc/git*/contrib/completion/git-completion.bash >/dev/null 2>&1' >>$MYBASHRC
}
install_docker()
{
local TAG=centos7.6.1810
has docker || curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
sudo systemctl start docker
docker images | grep $TAG >/dev/null || docker pull centos:centos7.6.1810
}
#after zsh
install_golang()
{
local go_gz=go1.15.1.linux-amd64.tar.gz
# go_gz=go1.13.11.linux-amd64.tar.gz
has go && return 0
curl -O https://dl.google.com/go/${go_gz}
tar -C /usr/local -xzf ${go_gz}
echo 'export PATH=$PATH:/usr/local/go/bin' >> ${MYBASHRC}
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
rm -rf $go_gz
}
install()
{
set -e
eval echo "TOPDIR=$(realpath $TOPDIR)" >$MYBASHRC
has tmux || sudo yum install -y wget tmux \
glibc-static pcre-devel deltarpm
# install_zsh
install_git
source conf.d/03-vim/install.sh
# install_python3_venv
# install_golang
# install_docker && echo "install success"
}
check_user()
{
read -r -p "setting develop environment for `whoami`, Are You Sure? [Y/n] " input;
case $input in
[yY][eE][sS]|[yY])
;;
[nN][oO]|[nN])
exit -1;
;;
*)
;;
esac
echo "begin setting for `whoami`"
}
usage()
{
echo "ls [OPTION]..."
echo " -u, --install"
echo " -q, --quiet"
echo " -h, --help"
}
uninstall()
{
echo "uninstall" ;
rm -f $MYBASHRC
}
main()
{
local TOPDIR=${TOPDIR:-./}
local MYQUITE=""
local MYUNINSTALL=""
while getopts 'a:qh' OPT; do
case $OPT in
a)
AA="$OPTARG";;
c|--clean)
CLEAN=true;;
u|--uninstall)
MYUNINSTALL=true;;
q|--quiet)
MYQUITE=true
shift
;;
*|h|--help)
usage
exit 0
;;
esac
done
[[ "$MYUNINSTALL" == true ]] && uninstall
[[ "$MYQUITE" == true ]] || check_user
install
}
main $@ -q
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/openrc/rc.git
[email protected]:openrc/rc.git
openrc
rc
rc
master

搜索帮助