diff --git a/.editorconfig b/.editorconfig index e6a12b2f0..0efa9900f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,6 +6,8 @@ root = true # Unix-style newlines with a newline ending every file [*] end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true insert_final_newline = true # Matches multiple files with brace expansion notation diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..59b47ae3e --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# style: Remove trailing whitespace and add missing final newlines +5cd1f0eb1668f06bf20378d6d4308fd4a1890581 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..f7d1c71c6 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,27 @@ +name: "Check EditorConfig Format" +on: + push: + branches: + - "*" + pull_request: + branches: + - "*" +jobs: + lint: + runs-on: "ubuntu-22.04" + steps: + - name: "Get Changed Files" + id: "files" + uses: "masesgroup/retrieve-changed-files@v2" + with: + format: "json" + - name: Check out code. + uses: actions/checkout@v2 + - name: "Check EditorConfig Lint" + env: + EDITORCONFIG_FLAGS: '-disable-indent-size -disable-indentation' + run: | + sudo apt install -y jq golang + go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest' + readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')" + ~/go/bin/editorconfig-checker ${{ env.EDITORCONFIG_FLAGS }} ${changed_files[@]} diff --git a/completions/gem.completion.sh b/completions/gem.completion.sh index 8cb86575f..ee4378d5e 100644 --- a/completions/gem.completion.sh +++ b/completions/gem.completion.sh @@ -6,7 +6,7 @@ function _installcomp { then REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') ) fi - + local cur=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $(compgen -W "${REMOTE_GEMS[*]}" -- $cur) ) } @@ -16,7 +16,7 @@ function _uninstallcomp { then LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') ) fi - + local cur=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $(compgen -W "${LOCAL_GEMS[*]}" -- $cur) ) } diff --git a/completions/git_flow.completion.sh b/completions/git_flow.completion.sh index 8f58c4df9..9f1dcd5a8 100644 --- a/completions/git_flow.completion.sh +++ b/completions/git_flow.completion.sh @@ -2,47 +2,47 @@ # # git-flow-completion # =================== -# +# # Bash completion support for [git-flow](http://github.com/nvie/gitflow) -# +# # The contained completion routines provide support for completing: -# +# # * git-flow init and version # * feature, hotfix and release branches # * remote feature branch names (for `git-flow feature track`) -# -# +# +# # Installation # ------------ -# +# # To achieve git-flow completion nirvana: -# +# # 0. Install git-completion. -# +# # 1. Install this file. Either: -# +# # a. Place it in a `bash-completion.d` folder: -# +# # * /etc/bash-completion.d # * /usr/local/etc/bash-completion.d # * ~/bash-completion.d -# +# # b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in # your .bashrc: -# +# # source ~/.git-flow-completion.sh -# +# # 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant # $command case in _git: -# +# # flow) _git_flow ;; -# -# +# +# # The Fine Print # -------------- -# +# # Copyright (c) 2010 [Justin Hileman](http://justinhileman.com) -# +# # Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) _git_flow () @@ -128,7 +128,7 @@ __git_flow_release () __gitcomp "$subcommands" return fi - + case "$subcommand" in finish) __gitcomp "$(__git_flow_list_releases)" @@ -174,4 +174,4 @@ __git_flow_list_hotfixes () # temporarily wrap __git_find_on_cmdline() for backwards compatibility if [ -z "`type -t __git_find_subcommand`" ]; then alias __git_find_subcommand=__git_find_on_cmdline -fi \ No newline at end of file +fi diff --git a/completions/jboss7.completion.sh b/completions/jboss7.completion.sh index b6cf44d89..26b4b12f3 100644 --- a/completions/jboss7.completion.sh +++ b/completions/jboss7.completion.sh @@ -15,17 +15,17 @@ function _serverProfiles { # assume is domain.sh serverdir="../domain/configuration/" fi - + for i in ${!COMP_WORDS[*]} do if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then serverdir="${COMP_WORDS[i+2]}/configuration" - fi - + fi + done if [ -d "${serverdir}" ] then - + IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)" local fls="${tmp[@]// /\ }" unset IFS @@ -43,13 +43,13 @@ function _bindingAddress { } function _jboss { - + local cur prev words cword COMPREPLY=() _get_comp_words_by_ref -n = cur prev words cword - + case $cur in - + -Djboss.socket.binding.port-offset=*) cur=${cur#*=} #static list of common bindings sets @@ -71,13 +71,13 @@ function _jboss { COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) ) return 0 ;; - + -Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*) cur=${cur#*=} _filedir -d return 0 ;; - + -Djboss.domain.master.address=*|-Djboss.bind.address*=*) cur=${cur#*=} _bindingAddress @@ -86,8 +86,8 @@ function _jboss { --server-config=*|-c=|--host-config=*) cur=${cur#*=} _serverProfiles - return 0 - + return 0 + esac @@ -111,14 +111,14 @@ function _jboss { ;; esac # *** from jboss5 ******************** - # *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory + # *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory # *** -Djboss.Domain -Djboss.modcluster.proxyList -Djboss.jvmRoute -Djboss.default.jgroups.stack -Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.port -Dcom.sun.management.jmxremote.ssl # ************************************* - + # standard commands for standalone and domain mode local commandsWithoutEqualSign='-b -bmanagement -bunsecure -bpublic --admin-only -h -help -u -version -V -v' local commandsWithEqualSign='-P -Djboss.node.name -Djboss.home.dir -Djboss.socket.binding.port-offset -Djboss.bind.address.management -Djboss.bind.address -Djboss.bind.address.unsecure' - + if [[ $COMP_WORDS == *standalone.sh* ]] then commandsWithoutEqualSign="${commandsWithoutEqualSign} -c" @@ -128,15 +128,15 @@ function _jboss { commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc" commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir " fi - - - - COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" ) - $( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) ) + + + + COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" ) + $( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) ) return 0 - + } complete -o nospace -F _jboss standalone.sh complete -o nospace -F _jboss domain.sh diff --git a/completions/maven.completion.sh b/completions/maven.completion.sh index a5d36c680..a3e55e04e 100644 --- a/completions/maven.completion.sh +++ b/completions/maven.completion.sh @@ -1,6 +1,6 @@ #! bash oh-my-bash.module # Bash completion support for maven -# inspired from : +# inspired from : # - https://github.com/juven/maven-bash-completion # - https://github.com/parisjug/maven-bash-completion @@ -67,7 +67,7 @@ __find_mvn_projects() } function_exists _realpath || -_realpath () +_realpath () { if [[ -f "$1" ]] then @@ -85,7 +85,7 @@ _realpath () fi else # file *cannot* exist - return 1 # failure + return 1 # failure fi # reassemble realpath @@ -105,13 +105,13 @@ __pom_hierarchy() ## is present but not defined, assume ../pom.xml if [ -z "$parent_pom_relative" ]; then parent_pom_relative="../pom.xml" - fi + fi ## if pom exists continue else break parent_pom=`_realpath "${pom%/*}/$parent_pom_relative"` - if [ -n "$parent_pom" ]; then + if [ -n "$parent_pom" ]; then pom=$parent_pom - else + else break fi POM_HIERARCHY+=("$pom") @@ -175,7 +175,7 @@ _mvn() local plugin_goals_liquibase="liquibase:changelogSync|liquibase:changelogSyncSQL|liquibase:clearCheckSums|liquibase:dbDoc|liquibase:diff|liquibase:dropAll|liquibase:help|liquibase:migrate|liquibase:listLocks|liquibase:migrateSQL|liquibase:releaseLocks|liquibase:rollback|liquibase:rollbackSQL|liquibase:status|liquibase:tag|liquibase:update|liquibase:updateSQL|liquibase:updateTestingRollback" local plugin_goals_nexus_staging="nexus-staging:close|nexus-staging:deploy|nexus-staging:deploy-staged|nexus-staging:deploy-staged-repository|nexus-staging:drop|nexus-staging:help|nexus-staging:promote|nexus-staging:rc-close|nexus-staging:rc-drop|nexus-staging:rc-list|nexus-staging:rc-list-profiles|nexus-staging:rc-promote|nexus-staging:rc-release|nexus-staging:release" #mvn help:describe -Dplugin=io.quarkus:quarkus-maven-plugin:0.15.0 - local plugin_goals_quarkus="quarkus:add-extension|quarkus:add-extensions|quarkus:analyze-call-tree|quarkus:build|quarkus:create|quarkus:create-example-config|quarkus:dev|quarkus:help|quarkus:list-extensions|quarkus:native-image|quarkus:remote-dev" + local plugin_goals_quarkus="quarkus:add-extension|quarkus:add-extensions|quarkus:analyze-call-tree|quarkus:build|quarkus:create|quarkus:create-example-config|quarkus:dev|quarkus:help|quarkus:list-extensions|quarkus:native-image|quarkus:remote-dev" local plugin_goals_pmd="pmd:pmd|pmd:cpd|pmd:check|pmd:cpd-check" local plugin_goals_properties="properties:read-project-properties|properties:write-project-properties|properties:write-active-profile-properties|properties:set-system-properties" local plugin_goals_release="release:clean|release:prepare|release:rollback|release:perform|release:stage|release:branch|release:update-versions" @@ -203,7 +203,7 @@ _mvn() local options="-Dmaven.test.skip=true|-DskipTests|-DskipITs|-Dtest|-Dit.test|-DfailIfNoTests|-Dmaven.surefire.debug|-DenableCiProfile|-Dpmd.skip=true|-Dcheckstyle.skip=true|-Dtycho.mode=maven|-Dmaven.javadoc.skip=true|-Dgwt.compiler.skip|-Dcobertura.skip=true|-Dfindbugs.skip=true||-DperformRelease=true|-Dgpg.skip=true|-DforkCount" local profile_settings=`[ -e ~/.m2/settings.xml ] && grep -e "" -A 1 ~/.m2/settings.xml | grep -e ".*" | sed 's/.*//' | sed 's/<\/id>.*//g' | tr '\n' '|' ` - + local profiles="${profile_settings}|" for item in ${POM_HIERARCHY[*]} do diff --git a/completions/virtualbox.completion.sh b/completions/virtualbox.completion.sh index 7a54ebfde..e27f408c7 100644 --- a/completions/virtualbox.completion.sh +++ b/completions/virtualbox.completion.sh @@ -23,16 +23,16 @@ function __vboxmanage_startvm { function __vboxmanage_list { INPUT=$(vboxmanage list | tr -s '[\[\]\|\n]' ' ' | cut -d' ' -f4-) - + PRUNED="" if [ "$1" == "long" ]; then for WORD in $INPUT; do [ "$WORD" == "-l" ] && continue; [ "$WORD" == "--long" ] && continue; - + PRUNED="$PRUNED $WORD" done - else + else PRUNED=$INPUT fi @@ -47,7 +47,7 @@ function __vboxmanage_list_vms { else SEPARATOR=$1 fi - + for VM in $(vboxmanage list vms | cut -d' ' -f1 | tr -d '"'); do [ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}" VMS="${VMS}${VM}" @@ -63,7 +63,7 @@ function __vboxmanage_list_runningvms { else SEPARATOR=$1 fi - + for VM in $(vboxmanage list runningvms | cut -d' ' -f1 | tr -d '"'); do [ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}" VMS="${VMS}${VM}" @@ -81,7 +81,7 @@ function __vboxmanage_controlvm { echo "screenshotpng setcredentials teleport plugcpu unplugcpu" echo "cpuexecutioncap" -# setlinkstate<1-N> +# setlinkstate<1-N> # nic<1-N> null|nat|bridged|intnet|hostonly|generic # [] | # nictrace<1-N> on|off @@ -136,9 +136,9 @@ function __vboxmanage_default { done (( $MATCH == 1 )) && continue; pruned="$pruned $WORD" - + done - + # COMPREPLY=($(compgen -W "${pruned}" -- ${cur})) echo $pruned return 0 @@ -156,13 +156,13 @@ function _vboxmanage { # In case current is complete command case $cur in - startvm|list|controlvm) + startvm|list|controlvm) COMPREPLY=($(compgen -W "$cur ")) return 0 ;; esac - case $prev in + case $prev in -v|--version) return 0 ;; @@ -170,13 +170,13 @@ function _vboxmanage { -l|--long) opts=$(__vboxmanage_list "long") COMPREPLY=($(compgen -W "${opts}" -- ${cur})) - return 0 + return 0 ;; startvm|list) opts=$(__vboxmanage_$prev) COMPREPLY=($(compgen -W "${opts}" -- ${cur})) - return 0 - ;; + return 0 + ;; --type) COMPREPLY=($(compgen -W "gui headless" -- ${cur})) return 0 @@ -204,7 +204,7 @@ function _vboxmanage { # echo "previous: $pprev" case $pprev in startvm) - opts="--type" + opts="--type" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 ;; @@ -219,4 +219,4 @@ function _vboxmanage { # echo "Got to end withoug completion" } -complete -F _vboxmanage vboxmanage \ No newline at end of file +complete -F _vboxmanage vboxmanage diff --git a/lib/base.sh b/lib/base.sh index 3a9631db1..c9ed54a22 100644 --- a/lib/base.sh +++ b/lib/base.sh @@ -247,7 +247,7 @@ function batch_chmod { (find . -type d -print0 | xargs -0 chmod 0755) & spinner echo -ne "${_omb_term_normal}" - + echo -ne "${_omb_term_bold_navy}Applying 0644 permission for all files..." (find . -type f -print0 | xargs -0 chmod 0644) & spinner diff --git a/plugins/bashmarks/README.md b/plugins/bashmarks/README.md index 67ee1d451..340d0c2f1 100644 --- a/plugins/bashmarks/README.md +++ b/plugins/bashmarks/README.md @@ -1,6 +1,6 @@ # Bashmarks plugin -The Bashmarks plugin allows you to create and use bookmarks for directories on your filesystems. +The Bashmarks plugin allows you to create and use bookmarks for directories on your filesystems. ## Quickstart @@ -8,9 +8,9 @@ Create a new bookmark using the *bm -a* command: `$ bm -a mydir` -The command above creates a bookmark for the current directory with the name *mydir*. +The command above creates a bookmark for the current directory with the name *mydir*. -You can navigate to the location of a bookmark using the *bm -g* command: +You can navigate to the location of a bookmark using the *bm -g* command: `$ bm -g mydir` @@ -20,7 +20,7 @@ You can also supply just any bookmark name and the *-g* option will be assumed: Tab completion is available when you need to enter a bookmark name in a command, such as when using *bm -g* -Easily list all bookmarks you have setup using the *bm -l* command. +Easily list all bookmarks you have setup using the *bm -l* command. ## Commands @@ -30,7 +30,7 @@ Easily list all bookmarks you have setup using the *bm -l* command. **bm [-g] bookmarkname** Go to the specified bookmark -**bm -p bookmarkname** Print the bookmark +**bm -p bookmarkname** Print the bookmark **bm -d bookmarkname** Delete a bookmark diff --git a/plugins/brew/README.md b/plugins/brew/README.md index b7ca8e8f3..7de6e8843 100644 --- a/plugins/brew/README.md +++ b/plugins/brew/README.md @@ -19,4 +19,4 @@ plugins=(... brew) | bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. | | bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. | | bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. | -| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. | \ No newline at end of file +| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. | diff --git a/plugins/brew/brew.plugin.sh b/plugins/brew/brew.plugin.sh index f8eb70718..e218a3c14 100644 --- a/plugins/brew/brew.plugin.sh +++ b/plugins/brew/brew.plugin.sh @@ -7,4 +7,4 @@ alias bubo='brew update && brew outdated' alias bubc='brew upgrade && brew cleanup' alias bubu='bubo && bubc' alias bcubo='brew update && brew cask outdated' -alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup' \ No newline at end of file +alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup' diff --git a/plugins/golang/golang.plugin.sh b/plugins/golang/golang.plugin.sh index b6bbcc5c2..b56448e57 100644 --- a/plugins/golang/golang.plugin.sh +++ b/plugins/golang/golang.plugin.sh @@ -14,4 +14,4 @@ alias gopb='cd $GOPATH/bin' alias gops='cd $GOPATH/src' alias gor='go run' alias got='go test' -alias gov='go vet' \ No newline at end of file +alias gov='go vet' diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index ee0429d46..9e58ad142 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -104,4 +104,4 @@ plugins=(... kubectl) | kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | | kdelss | `kubectl delete statefulset` | Delete the statefulset | | ksss | `kubectl scale statefulset` | Scale a statefulset | -| krsss | `kubectl rollout status statefulset`| Check the rollout status of a deployment | \ No newline at end of file +| krsss | `kubectl rollout status statefulset`| Check the rollout status of a deployment | diff --git a/plugins/npm/README.md b/plugins/npm/README.md index 94d4cc8be..d4490abde 100644 --- a/plugins/npm/README.md +++ b/plugins/npm/README.md @@ -24,4 +24,4 @@ plugins=(... npm) | `npmt` | `npm test` | Run npm test | | `npmR` | `npm run` | Run npm scripts | | `npmP` | `npm publish` | Run npm publish | -| `npmI` | `npm init` | Run npm init | \ No newline at end of file +| `npmI` | `npm init` | Run npm init | diff --git a/plugins/npm/npm.plugin.sh b/plugins/npm/npm.plugin.sh index 3e68e31b5..9b3aeee68 100644 --- a/plugins/npm/npm.plugin.sh +++ b/plugins/npm/npm.plugin.sh @@ -38,8 +38,8 @@ alias npmt="npm test" # Run npm scripts alias npmR="npm run" -# Run npm publish +# Run npm publish alias npmP="npm publish" # Run npm init -alias npmI="npm init" \ No newline at end of file +alias npmI="npm init" diff --git a/plugins/nvm/nvm.plugin.sh b/plugins/nvm/nvm.plugin.sh index 31f9328f3..f4fe3ac18 100644 --- a/plugins/nvm/nvm.plugin.sh +++ b/plugins/nvm/nvm.plugin.sh @@ -1,5 +1,5 @@ #! bash oh-my-bash.module -# Description: automatically load nvm +# Description: automatically load nvm # # @var[opt] OMB_PLUGIN_NVM_AUTO_USE enable .nvmrc autoload @@ -52,7 +52,7 @@ if _omb_util_command_exists nvm && [[ ${OMB_PLUGIN_NVM_AUTO_USE-} == true ]]; th done echo "$path" } - + function _omb_plugin_nvm_cd { cd "$@" || return "$?" local nvm_path=$(_omb_plugin_nvm_find_up .nvmrc) diff --git a/plugins/progress/progress.plugin.sh b/plugins/progress/progress.plugin.sh index e6e034448..9f377dd38 100644 --- a/plugins/progress/progress.plugin.sh +++ b/plugins/progress/progress.plugin.sh @@ -11,7 +11,7 @@ ############################---Usage---######################################### # Copy below functions (delay and progress fuctions) into your shell script directly -# Then invoke progress function to show progress bar +# Then invoke progress function to show progress bar # In other way, you could import source indirectly then using. Nothing different @@ -28,7 +28,7 @@ function delay() # # Description : print out executing progress -# +# CURRENT_PROGRESS=0 function progress() { diff --git a/plugins/pyenv/pyenv.plugin.sh b/plugins/pyenv/pyenv.plugin.sh index 88f8fd5e9..41c1f7934 100644 --- a/plugins/pyenv/pyenv.plugin.sh +++ b/plugins/pyenv/pyenv.plugin.sh @@ -1,7 +1,7 @@ #! bash oh-my-bash.module # @chopnico 2021 -if [ -d ~/.pyenv ]; then +if [ -d ~/.pyenv ]; then export PYENV_ROOT=~/.pyenv export PATH=$PYENV_ROOT/bin${PATH:+:$PATH} eval -- "$(pyenv init --path)" diff --git a/templates/bashrc.osh-template b/templates/bashrc.osh-template index 591a05ca4..b7a1c1827 100644 --- a/templates/bashrc.osh-template +++ b/templates/bashrc.osh-template @@ -97,7 +97,7 @@ plugins=( # Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*) # Custom plugins may be added to ~/.oh-my-bash/custom/plugins/ -# Example format: +# Example format: # if [ "$DISPLAY" ] || [ "$SSH" ]; then # plugins+=(tmux-autoattach) # fi diff --git a/themes/absimple/absimple.theme.sh b/themes/absimple/absimple.theme.sh index fa0e3c782..545abf946 100644 --- a/themes/absimple/absimple.theme.sh +++ b/themes/absimple/absimple.theme.sh @@ -80,7 +80,7 @@ function _omb_theme_PROMPT_COMMAND { PS1="" # date randomly or once per hour - if (( $(shuf -i 1-20 -n 1 --random-source=/dev/urandom) == 1 )) ; then #TK || (($PSDATE != $(date +%H))) ; then + if (( $(shuf -i 1-20 -n 1 --random-source=/dev/urandom) == 1 )) ; then #TK || (($PSDATE != $(date +%H))) ; then PS1+="\$(date +%a) $(date +%Y-%m-%d) " fi PSDATE=$(date +%H) diff --git a/themes/hawaii50/hawaii50.theme.sh b/themes/hawaii50/hawaii50.theme.sh index 7007d8b31..f8ab15033 100644 --- a/themes/hawaii50/hawaii50.theme.sh +++ b/themes/hawaii50/hawaii50.theme.sh @@ -1,6 +1,6 @@ #! bash oh-my-bash.module # -# This theme was obviously inspired a lot by +# This theme was obviously inspired a lot by # # - Demula theme # @@ -17,8 +17,8 @@ # - configurable directory length # - hg, svn, git detection (I work in all of them) # - virtualenv, rvm + gemsets -# -# Screenshot: http://i.imgur.com/4IAMJ.png +# +# Screenshot: http://i.imgur.com/4IAMJ.png # # by Ryan Kanno # @@ -26,7 +26,7 @@ # # Note: I also am really new to this bash scripting game, so if you see things # that are flat out wrong, or if you think of something neat, just send a pull -# request. This probably only works on a Mac - as some functions are OS +# request. This probably only works on a Mac - as some functions are OS # specific like getting ip, etc. # @@ -88,11 +88,11 @@ function get_ip_info { echo -e "$(ips | sed -e :a -e '$!N;s/\n/${IP_SEPARATOR}/;ta' | sed -e 's/127\.0\.0\.1\${IP_SEPARATOR}//g'), ${myip}" } -# Displays ip prompt +# Displays ip prompt function ip_prompt_info() { if [[ $IP_ENABLED == 1 ]]; then echo -e " ${DEFAULT_COLOR}(${IP_COLOR}$(get_ip_info)${DEFAULT_COLOR})" - fi + fi } # Displays virtual info prompt (virtualenv/rvm) @@ -163,10 +163,10 @@ function svn_prompt_info() { echo -e "$prefix${REF_COLOR}$ref${DEFAULT_COLOR}:$revision$state$suffix" } -# Displays last X characters of pwd +# Displays last X characters of pwd function limited_pwd() { - # Replace $HOME with ~ if possible + # Replace $HOME with ~ if possible local RELATIVE_PWD=${PWD/#$HOME/\~} local offset=$((${#RELATIVE_PWD}-$MAX_PWD_LENGTH)) diff --git a/themes/n0qorg/n0qorg.theme.sh b/themes/n0qorg/n0qorg.theme.sh index 6db7c5b3a..ced3a54a3 100644 --- a/themes/n0qorg/n0qorg.theme.sh +++ b/themes/n0qorg/n0qorg.theme.sh @@ -19,7 +19,6 @@ GIT_THEME_PROMPT_PREFIX="${_omb_prompt_bold_navy}(${_omb_prompt_bold_white}" GIT_THEME_PROMPT_SUFFIX="${_omb_prompt_bold_navy})" ## alternate chars -# SCM_THEME_PROMPT_DIRTY="*" SCM_THEME_PROMPT_CLEAN="" SCM_THEME_PROMPT_PREFIX="(" diff --git a/themes/pure/pure.theme.sh b/themes/pure/pure.theme.sh index 2fef1fe2b..db713d236 100644 --- a/themes/pure/pure.theme.sh +++ b/themes/pure/pure.theme.sh @@ -15,13 +15,13 @@ SCM_HG_CHAR="${_omb_prompt_bold_brown}☿${_omb_prompt_normal}" # export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' function scm_prompt { - CHAR=$(scm_char) - if [ $CHAR = $SCM_NONE_CHAR ] - then + CHAR=$(scm_char) + if [ $CHAR = $SCM_NONE_CHAR ] + then return - else + else echo "[$(scm_char)$(scm_prompt_info)]" - fi + fi } function _omb_theme_PROMPT_COMMAND { diff --git a/themes/pzq/pzq.theme.sh b/themes/pzq/pzq.theme.sh index b1a3c4481..4a0ed20f8 100644 --- a/themes/pzq/pzq.theme.sh +++ b/themes/pzq/pzq.theme.sh @@ -90,7 +90,7 @@ function limited_pwd { # Max length of PWD to display local MAX_PWD_LENGTH=20 - # Replace $HOME with ~ if possible + # Replace $HOME with ~ if possible local RELATIVE_PWD=${PWD/#$HOME/\~} local offset=$((${#RELATIVE_PWD}-MAX_PWD_LENGTH)) @@ -112,7 +112,7 @@ function _omb_theme_PROMPT_COMMAND { local MOVE_CURSOR_RIGHTMOST='\e['${COLUMNS:-9999}'C' local MOVE_CURSOR_5_LEFT='\e[5D' local THEME_CLOCK_FORMAT="%H:%M:%S %y-%m-%d" - # Replace $HOME with ~ if possible + # Replace $HOME with ~ if possible local RELATIVE_PWD=${PWD/#$HOME/\~} local python_venv diff --git a/themes/sirup/sirup.theme.sh b/themes/sirup/sirup.theme.sh index b1d8a922d..7fdea64ba 100644 --- a/themes/sirup/sirup.theme.sh +++ b/themes/sirup/sirup.theme.sh @@ -15,7 +15,7 @@ function _omb_theme_sirup_rubygem { local full=$version$gemset [[ $full ]] && echo "$full" } - + function _omb_theme_PROMPT_COMMAND { # Check http://github.com/Sirupsen/dotfiles for screenshot local python_venv diff --git a/themes/zork/zork.theme.sh b/themes/zork/zork.theme.sh index 6966a62b7..e472eeeed 100644 --- a/themes/zork/zork.theme.sh +++ b/themes/zork/zork.theme.sh @@ -50,7 +50,7 @@ function modern_scm_prompt { # show chroot if exist function chroot { if [ -n "$debian_chroot" ] - then + then my_ps_chroot="${_omb_prompt_bold_teal}$debian_chroot${_omb_prompt_normal}"; echo "($my_ps_chroot)"; fi @@ -59,7 +59,7 @@ function chroot { # show virtualenvwrapper function my_ve { if [ -n "$VIRTUAL_ENV" ] - then + then my_ps_ve="${_omb_prompt_bold_purple}$ve${_omb_prompt_normal}"; echo "($my_ps_ve)"; fi @@ -71,7 +71,7 @@ function _omb_theme_PROMPT_COMMAND { my_ps_host="${_omb_prompt_green}\h${_omb_prompt_normal}"; # yes, these are the the same for now ... my_ps_host_root="${_omb_prompt_green}\h${_omb_prompt_normal}"; - + my_ps_user="${_omb_prompt_bold_green}\u${_omb_prompt_normal}" my_ps_root="${_omb_prompt_bold_brown}\u${_omb_prompt_normal}"; diff --git a/tools/install.sh b/tools/install.sh index b53f1ae72..6cca583bf 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -140,7 +140,7 @@ function _omb_install_has_proper_bash_profile { return 0 fi fi - + return 1 } diff --git a/tools/uninstall.sh b/tools/uninstall.sh index 83042dc2a..1e291559d 100755 --- a/tools/uninstall.sh +++ b/tools/uninstall.sh @@ -11,6 +11,8 @@ _omb_uninstall_contains_omb() { _omb_uninstall_find_bashrc_original() { _omb_uninstall_bashrc_original= printf '%s\n' "Looking for original bash config..." + _omb_uninstall_old_ifs_set=${IFS+set} + _omb_uninstall_old_ifs=${IFS-} IFS=' ' for _omb_uninstall_file in $(printf '%s\n' ~/.bashrc.omb-backup-?????????????? | sort -r) ~/.bashrc.pre-oh-my-bash; do @@ -19,9 +21,13 @@ _omb_uninstall_find_bashrc_original() { _omb_uninstall_bashrc_original=$_omb_uninstall_file break done - unset _omb_uninstall_file - IFS=' -' + if [ "$_omb_uninstall_old_ifs_set" = set ]; then + IFS=$_omb_uninstall_old_ifs + else + unset -v IFS + fi + unset -v _omb_uninstall_file _omb_uninstall_old_ifs_set _omb_uninstall_old_ifs + if [ -n "$_omb_uninstall_bashrc_original" ]; then printf '%s\n' "-> Found at '$_omb_uninstall_bashrc_original'." else