代码拉取完成,页面将自动刷新
同步操作将从 Plato/plato 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。