4 Star 2 Fork 1

Plato / plato

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install.sh 2.31 KB
一键复制 编辑 原始数据 按行查看 历史
dennis-kk 提交于 2022-09-01 20:43 . plato java
#!/bin/bash
abs_path=`pwd`
version=$(python -V 2>&1 | grep -Po '(?<=Python )(.+)')
if [[ -z "$version" ]]
then
echo "Python not found"
exit 1
fi
parsedVersion=$(echo "${version//./}")
if [[ "$parsedVersion" -lt "300" ]]
then
echo "Valid version"
exit 1
fi
# generate your own plato file
cat > plato <<EOF
#!/bin/bash
if [ -x "\$(command -v python3)" ]; then
python3 ${abs_path}/plato.py \$*
else
python ${abs_path}/plato.py \$*
fi
EOF
cat > platocpp <<EOF
#!/bin/bash
if [ -x "\$(command -v python3)" ]; then
python3 ${abs_path}/platocpp.py \$*
else
python ${abs_path}/platocpp.py \$*
fi
EOF
cat > platolua <<EOF
#!/bin/bash
if [ -x "\$(command -v python3)" ]; then
python3 ${abs_path}/platolua.py \$*
else
python ${abs_path}/platolua.py \$*
fi
EOF
cat > platogo <<EOF
#!/bin/bash
GOP=\`go env GOPATH\`
export PATH="\${GOP}/bin:\$PATH"
if [ -x "\$(command -v python3)" ]; then
python3 ${abs_path}/platogo.py \$*
else
python ${abs_path}/platogo.py \$*
fi
EOF
cat > platopy <<EOF
#!/bin/bash
if [ -x "\$(command -v python3)" ]; then
python3 ${abs_path}/platopy.py \$*
else
python ${abs_path}/platopy.py \$*
fi
EOF
cat > platopy2 <<EOF
#!/bin/bash
if [ -x "\$(command -v python3)" ]; then
python3 ${abs_path}/platopy2.py \$*
else
python ${abs_path}/platopy2.py \$*
fi
EOF
cat > platojava <<EOF
#!/bin/bash
if [ -x "\$(command -v python3)" ]; then
python3 ${abs_path}/platojava.py \$*
else
python ${abs_path}/platojava.py \$*
fi
EOF
chmod 755 ./plato
chmod 755 ./platocpp
chmod 755 ./platolua
chmod 755 ./platogo
chmod 755 ./platopy
chmod 755 ./platopy2
chmod 755 ./platojava
#清理链接文件
if [ -L /usr/bin/plato ];then
rm /usr/bin/plato
fi
if [ -L /usr/bin/platocpp ];then
rm /usr/bin/platocpp
fi
if [ -L /usr/bin/platolua ];then
rm /usr/bin/platolua
fi
if [ -L /usr/bin/platogo ];then
rm /usr/bin/platogo
fi
if [ -L /usr/bin/platopy ];then
rm /usr/bin/platopy
fi
if [ -L /usr/bin/platopy2 ];then
rm /usr/bin/platopy2
fi
if [ -L /usr/bin/platojava ];then
rm /usr/bin/platojava
fi
ln -s ${abs_path}/plato /usr/bin/plato
ln -s ${abs_path}/platocpp /usr/bin/platocpp
ln -s ${abs_path}/platolua /usr/bin/platolua
ln -s ${abs_path}/platogo /usr/bin/platogo
ln -s ${abs_path}/platopy /usr/bin/platopy
ln -s ${abs_path}/platopy2 /usr/bin/platopy2
ln -s ${abs_path}/platojava /usr/bin/platojava
Python
1
https://gitee.com/dennis-kk/plato.git
git@gitee.com:dennis-kk/plato.git
dennis-kk
plato
plato
v0.4.0-alpha

搜索帮助

53164aa7 5694891 3bd8fe86 5694891