Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
- Disable useless file selection
- Disable telemetry
- Update comments
  • Loading branch information
Morgan Rodgers committed Oct 21, 2019
1 parent 44e18cd commit 3082790
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 6 additions & 2 deletions template/script.sh.erb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 %>"

0 comments on commit 3082790

Please sign in to comment.