因此,我正在调整我的dotfile以自动安装包,并希望自动检测安装脚本是否在吉塔工作区中运行。这是我目前拥有的:
if is-executable "gp"; then
echo "Gitpod detected, not installing <pre-installed package>"
else
# Continue with installation... rest of code goes here
fi我知道gp是一个在Gitpod中可用的命令,因为它是CLI的,上面的代码工作得很好,但是它并不理想,假设其他包在Gitpod之外也有gp命令(尽管我不使用它们)。那么,如果在Gitpod中运行一个Bash脚本,有什么更好的方法来检测呢?
https://stackoverflow.com/questions/72561982
复制相似问题