未验证 提交 7705a05e 编写于 作者: A Anmol Sethi

install.sh: Add should_update to prevent reinstalling if already installed

Updates #2219
上级 650c88ce
......@@ -201,6 +201,10 @@ main() {
exit 1
fi
if ! should_update; then
return 0
fi
distro_name
ARCH="$(arch)"
......@@ -489,6 +493,21 @@ arch() {
esac
}
should_update() {
if ! command_exists code-server; then
return 0
fi
installed_version="$(code-server --version | cut -d " " -f1)"
if [ "$installed_version" != "$VERSION" ]; then
echo "updating as installed version v$installed_version does not match version v$VERSION"
return 0
fi
echo "already on version v$VERSION"
return 1
}
command_exists() {
command -v "$@" > /dev/null
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册