Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify extensions to add in init #39

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions colabcode/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def __init__(
self._mount = mount_drive
self._code = code
self._install_code()
self._install_extensions()
self._start_server()
if self._code:
self._run_code()
Expand All @@ -46,6 +45,7 @@ def _install_extensions():
for ext in EXTENSIONS:
subprocess.run(["code-server", "--install-extension", f"{ext}"])


def _start_server(self):
if self.authtoken:
ngrok.set_auth_token(self.authtoken)
Expand All @@ -64,9 +64,9 @@ def _run_code(self):
if self._mount and colab_env:
drive.mount("/content/drive")
if self.password:
code_cmd = f"PASSWORD={self.password} code-server --port {self.port} --disable-telemetry"
code_cmd = f"PASSWORD={self.password} code-server /content/drive/'My Drive' --port {self.port} --disable-telemetry"
else:
code_cmd = f"code-server --port {self.port} --auth none --disable-telemetry"
code_cmd = f"code-server /content/drive/'My Drive' --port {self.port} --auth none --disable-telemetry"
with subprocess.Popen(
[code_cmd],
shell=True,
Expand Down