File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Stops script execution if a command has an error
4
+ set -e
5
+
6
+ INSTALL_ONLY=0
7
+ # Loop through arguments and process them: https://pretzelhands.com/posts/command-line-flags
8
+ for arg in " $@ " ; do
9
+ case $arg in
10
+ -i|--install) INSTALL_ONLY=1 ; shift ;;
11
+ * ) break ;;
12
+ esac
13
+ done
14
+
15
+ if ! hash java 2> /dev/null; then
16
+ echo " Installing Java Runtime. Please wait..."
17
+ apt-get update
18
+ apt-get install -y --no-install-recommends openjdk-11-jdk maven scala && \
19
+ else
20
+ echo " Java Runtime is already installed"
21
+ fi
22
+
23
+ # Install vscode go extension
24
+ if hash code 2> /dev/null; then
25
+ LD_LIBRARY_PATH=" " LD_PRELOAD=" " code --user-data-dir=$HOME /.config/Code/ --extensions-dir=$HOME /.vscode/extensions/ --install-extension redhat.java
26
+ else
27
+ echo " Please install the desktop version of vscode via the vs-code-desktop.sh script to install go vscode extensions."
28
+ fi
29
+
30
+ # Run
31
+ if [ $INSTALL_ONLY = 0 ] ; then
32
+ echo " Use java via command-line:"
33
+ java --help
34
+ sleep 20
35
+ fi
36
+
You can’t perform that action at this time.
0 commit comments