diff --git a/.editorconfig b/.editorconfig index 6ea1d21..4faf23d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,44 +1,37 @@ -# top-most EditorConfig file root = true -# defaults [*] -charset=utf-8 +charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -end_of_line=lf +end_of_line = lf indent_size = 4 indent_style = space -[*.sh] -indent_size = 2 - [*.md] trim_trailing_whitespace = false indent_size = 2 [*.{java,kt,kts}] continuation_indent_size = 4 -max_line_length=120 -wildcard_import_limit=99 +max_line_length = 120 +wildcard_import_limit = 99 [*.xml] +indent_size = 2 continuation_indent_size = 8 -# YAML -# http://yaml.org/spec/1.2/2009-07-21/spec.html#id2576668 [*.{yaml,yml}] indent_size = 2 -# Shell -# https://google.github.io/styleguide/shell.xml#Indentation -[*.{bash,sh,zsh},bashrc] +[*.{sh,bash,zsh}] +indent_size = 2 + +[bashrc] indent_size = 2 -# HTML -# https://google.github.io/styleguide/htmlcssguide.xml#General_Formatting_Rules [*.{htm,html}] indent_size = 2 [*.json] -indent_size=2 +indent_size = 2 diff --git a/rc.local/gitprompt.sh b/rc.local/gitprompt.sh deleted file mode 100644 index a77571b..0000000 --- a/rc.local/gitprompt.sh +++ /dev/null @@ -1,3 +0,0 @@ -nop ${GIT_PROMPT_INIT:="$HOME/.bash-git-prompt/gitprompt.sh"} -nop ${GIT_PROMPT_ONLY_IN_REPO:=1} -source_try "$GIT_PROMPT_INIT" diff --git a/rc.local/golang.sh.bak b/rc.local/golang.sh.bak deleted file mode 100644 index 60b0faa..0000000 --- a/rc.local/golang.sh.bak +++ /dev/null @@ -1,4 +0,0 @@ -prepend_path_try "$HOME/go/bin" -if can_run go; then - export GOROOT=$(go env GOROOT) -fi diff --git a/rc.local/sdkman.sh b/rc.local/sdkman.sh index 8d7e1ba..c8a6274 100644 --- a/rc.local/sdkman.sh +++ b/rc.local/sdkman.sh @@ -1,3 +1,5 @@ nop "${SDKMAN_DIR:=$HOME/.sdkman}" -export SDKMAN_DIR -source_try "$SDKMAN_DIR/bin/sdkman-init.sh" +if [[ -d $SDKMAN_DIR ]]; then + export SDKMAN_DIR + source_try "$SDKMAN_DIR/bin/sdkman-init.sh" +fi diff --git a/rc.local/wsl.sh b/rc.local/wsl.sh index bf94add..e1031ed 100644 --- a/rc.local/wsl.sh +++ b/rc.local/wsl.sh @@ -1,3 +1,10 @@ -prepend_path_try "$HOME/.local/bin" -append_path_try "$HOME/.arkade/bin" -append_path_try "$HOME/.cargo/bin" +function is_wsl() +{ + grep -q -i wsl /proc/version +} + +if is_wsl; then + prepend_path_try "$HOME/.local/bin" + append_path_try "$HOME/.arkade/bin" + append_path_try "$HOME/.cargo/bin" +fi diff --git a/rc.local/dotnet.sh b/rc/dotnet.sh similarity index 100% rename from rc.local/dotnet.sh rename to rc/dotnet.sh diff --git a/rc/go-env.sh.skip b/rc/go-env.sh.skip index 78544e6..21a7008 100644 --- a/rc/go-env.sh.skip +++ b/rc/go-env.sh.skip @@ -1,6 +1,15 @@ -# Use user defined Go version +# Use user defined Go version # GOPATH and GOROOT must be already set in $HOME/.bashrc +_GO_BIN_DIR="$HOME/go/bin" + +if [[ -d "$_GO_BIN_DIR"]]; then + prepend_path_try "$_GO_BIN_DIR" + if can_run go; then + export GOROOT=$(go env GOROOT) + fi +fi + if [[ ! -z "$GOPATH" ]]; then prepend_path "$GOPATH/bin" fi @@ -8,4 +17,3 @@ fi if [[ ! -z "$GOROOT" ]]; then prepend_path "$GOROOT/bin" fi -