%%script bash
command_output="$(ruby -v)"
if [[ "$command_output" != "ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]" ]]; then
echo "Ruby is not installed. Installing Ruby"
apt install ruby
else
echo "Ruby is installed"
fi #If the ruby is not installed, then the system will install Ruby by itself. If the ruby is installed, then the system will print out "Ruby is installed".
command_output="$(python -V)"
if [[ "$command_output" != "Python 3.10.12" ]]; then
echo "Python is not installed. Installing Python"
apt install python
else
echo "Python is installed"
fi #If the Python is not installed, then the system will install Python by itself. If the Python is installed, then the system will print out "Python is installed".
command_output="$(jupyter --v)"
if [[ "$command_output" != "Selected Jupyter core packages...
IPython : 7.31.1
ipykernel : 6.7.0
ipywidgets : 6.0.0
jupyter_client : 7.1.2
jupyter_core : 4.9.1
jupyter_server : not installed
jupyterlab : not installed
nbclient : 0.5.6
nbconvert : 6.4.0
nbformat : 5.1.3
notebook : 6.4.8
qtconsole : not installed
traitlets : 5.1.1" ]]; then
echo "jupyter is not installed. Installing jupyter"
apt install jupyter
else
echo "jupyter is installed"
fi #If the jupyter is not installed, then the system will install jupyter by itself. If the jupyter is installed, then the system will print out "jupyter is installed".
cd
echo "Current directory: " + $(pwd)
if [[ $(ls | grep "vscode") == "vscode" ]]; then
echo "vscode directory exists"
else
mkdir "$current_directory/vscode" # Create the directory in the current directory
echo "Creating vscode directory"
fi
Ruby is installed
Python is installed
jupyter is installed
Current directory: + /home/kasm-user
vscode directory exists