summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:55:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:55:48 +0000
commit8be448d3881909fb0ce4b033cad71aa7575de0aa (patch)
treeda33caff06645347a08c3c9c56dd703e4acb5aa3 /scripts
parentInitial commit. (diff)
downloadlsprotocol-8be448d3881909fb0ce4b033cad71aa7575de0aa.tar.xz
lsprotocol-8be448d3881909fb0ce4b033cad71aa7575de0aa.zip
Adding upstream version 2023.0.0.upstream/2023.0.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/onCreateCommand.sh28
-rw-r--r--scripts/postCreateCommand.sh3
2 files changed, 31 insertions, 0 deletions
diff --git a/scripts/onCreateCommand.sh b/scripts/onCreateCommand.sh
new file mode 100644
index 0000000..f867da4
--- /dev/null
+++ b/scripts/onCreateCommand.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Install pyenv and Python versions here to avoid using shim.
+curl https://pyenv.run | bash
+echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
+echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
+
+export PYENV_ROOT="$HOME/.pyenv"
+command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
+# eval "$(pyenv init -)" Comment this out and DO NOT use shim.
+source ~/.bashrc
+
+# Install Rust and Cargo
+curl https://sh.rustup.rs -sSf | bash -s -- -y
+echo 'source $HOME/.cargo/env' >> ~/.bashrc
+
+# Install Python via pyenv .
+pyenv install 3.8:latest 3.9:latest 3.10:latest 3.11:latest
+
+# Set default Python version to 3.8 .
+pyenv global 3.8.18
+
+# Create Virutal environment.
+pyenv exec python3.8 -m venv .venv
+
+# Activate Virtual environment.
+source /workspaces/lsprotocol/.venv/bin/activate
+
diff --git a/scripts/postCreateCommand.sh b/scripts/postCreateCommand.sh
new file mode 100644
index 0000000..805c353
--- /dev/null
+++ b/scripts/postCreateCommand.sh
@@ -0,0 +1,3 @@
+source /workspaces/lsprotocol/.venv/bin/activate
+python -m pip install nox
+python -m pip install -r ./packages/python/requirements.txt -r ./requirements.txt \ No newline at end of file