Skip to content

Comments

Always installs latest version of code server#112

Open
Mahesha999 wants to merge 1 commit intoabhishekkrthakur:masterfrom
Mahesha999:master
Open

Always installs latest version of code server#112
Mahesha999 wants to merge 1 commit intoabhishekkrthakur:masterfrom
Mahesha999:master

Conversation

@Mahesha999
Copy link

Removes hardcoded vscode version CODESERVER_VERSION. Thus, it always installs latest version of code server. With hard coded version, I was unable to install the extensions from the vscode extensions marketplace. Also it seems that ngrok now requires users to create authtoken. So, this version might need users to provide their authtoken:

ColabCode(port=80, password="<enter-password>", mount_drive=True, authtoken='<enter-your-ngrok-auth-token>`)

Sample colab notebook to boot up with colabcode.

subprocess.run(["wget", "https://code-server.dev/install.sh"], stdout=subprocess.PIPE)
subprocess.run(
["sh", "install.sh", "--version", f"{CODESERVER_VERSION}"],
# ["sh", "install.sh", "--version", f"{CODESERVER_VERSION}"],
Copy link

@sb0210 sb0210 Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall Code can be improved.
output of subprocess.run command is not taken care of.
Comments can be removed.

def _install_code():
    result = subprocess.run(["wget", "https://code-server.dev/install.sh"], stdout=subprocess.PIPE)
    if result.returncode != 0:
        raise RuntimeError("Failed to download installation script")
        
    result = subprocess.run(["sh", "install.sh"], stdout=subprocess.PIPE)
    if result.returncode != 0:
        raise RuntimeError("Failed to run installation script")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants