1 Star 0 Fork 1

jiaoyuedave/plato

forked from Plato/plato 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install.sh 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
CloudGuan 提交于 2022-03-18 06:31 . bug: fix install bug
#!/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
chmod 755 ./plato
chmod 755 ./platocpp
chmod 755 ./platolua
chmod 755 ./platogo
chmod 755 ./platopy
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/jiaoyuedave/plato.git
git@gitee.com:jiaoyuedave/plato.git
jiaoyuedave
plato
plato
master

搜索帮助