【发布时间】:2021-03-04 17:33:00
【问题描述】:
我正在尝试在云外壳启动时安装代码服务器, 所以,我创建了文件 .customize_environment
nano $HOME/.customize_environment
内容是:
echo "installing code server..."
curl -fsSL https://code-server.dev/install.sh | sh
PATH="$HOME/.local/bin:$PATH"
echo "code-server installed"
当云外壳启动时,它仍会打印默认消息
Welcome to Cloud Shell! Type "help" to get started.
Your Cloud Platform project in this session is set to
而不是installing code server...,并且不安装code-server。
【问题讨论】:
-
将此行作为第一行添加到您的脚本中:
#!/bin/sh。您可能还需要此更改export PATH=$HOME/.local/bin:$PATH(导出 + 无引号)。
标签: visual-studio-code google-cloud-platform google-cloud-shell code-server