#!/bin/bash

# load vscode-profile script
if test -e /etc/rstudio/vscode-profile
then
   . /etc/rstudio/vscode-profile
fi

# session arguments
# escape backslashes in arguments to pass safely to bash below
VSCODE_ARGS="${@//\\/\\\\}"

# run the session
/bin/bash --login $VSCODE_PROFILE_OPTIONS -c "$VSCODE_EXEC_COMMAND $VSCODE_ARGS"
exit $?
