From 3082790ee69c82fe6fe757074da7d8d18c7d7e3d Mon Sep 17 00:00:00 2001 From: Morgan Rodgers Date: Mon, 21 Oct 2019 11:46:15 -0400 Subject: [PATCH] Improvements - Disable useless file selection - Disable telemetry - Update comments --- form.yml | 1 + template/script.sh.erb | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/form.yml b/form.yml index d980efd..68df141 100644 --- a/form.yml +++ b/form.yml @@ -8,5 +8,6 @@ attributes: working_dir: label: "Working Directory" data-filepicker: true + data-target-file-type: dirs # Valid values are: files, dirs, or both readonly: false help: "Select your project directory; defaults to $HOME" \ No newline at end of file diff --git a/template/script.sh.erb b/template/script.sh.erb index 9a1933d..b258b2f 100755 --- a/template/script.sh.erb +++ b/template/script.sh.erb @@ -1,17 +1,19 @@ #!/usr/bin/env bash -<%- +<%- + # Ensure that code-server always starts up in either a user defined directory or the home directory working_dir = Pathname.new(context.working_dir) if ! working_dir.exist? || working_dir.to_s.empty? working_dir = Pathname.new(ENV['HOME']) elsif working_dir.file? working_dir = working_dir.parent - end + end %> # Ensure a dataroot for Code Server CODE_SERVER_DATAROOT="$HOME/.local/share/bc_osc_codeserver" mkdir -p "$CODE_SERVER_DATAROOT/extensions" +# Expose the password to the server export PASSWORD="$password" # VSCode complains that system git is too old @@ -21,9 +23,11 @@ module load git # Start Code Server # +# An arbitrary path... /fs/project/PZS0714/mrodgers/bin/code-server-2.1523-vsc1.38.1 \ --auth=password \ --port="$port" \ + --disable-telemetry \ --extra-extensions-dir="$CODE_SERVER_DATAROOT/extensions" \ --user-data-dir="$CODE_SERVER_DATAROOT" \ "<%= working_dir.to_s %>" \ No newline at end of file