profile
viewpoint
Nils Winkler nwinkler FIS Frankfurt, Germany

nwinkler/atom-keyboard-shortcuts 1758

A list of keyboard shortcuts for the Atom text editor

nwinkler/dotfiles 6

My dotfiles, managed through Homesick (https://github.com/technicalpickles/homesick)

nwinkler/bookmarklet 5

Creates a shortened bookmarklet from your JavaScript code in the Atom editor

nwinkler/AkkaPi 2

Akka Tutorial (Pi) in Java

nwinkler/bash-it 2

A community bash framework.

nwinkler/git-credential-helper 2

Node library that allows using the git credential API

nwinkler/awesome-browser-extensions-for-github 1

A collection of awesome browser extensions for GitHub.

nwinkler/awesome-shell 1

A curated list of awesome command-line frameworks, toolkits, guides and gizmos. Inspired by awesome-php.

nwinkler/create-junit-report 1

Creates a JUnit XML file based on the provided input parameters.

pull request commentBash-it/bash-it

support multiple paths in pathmunge

Thanks for working through this! So is it OK to merge this as-is? I've seen that you made changes to pathmunge to support multiple path segments and added more test cases - OK to merge this? And then you address the go items at a later stage?

cornfeedhobo

comment created time in 17 hours

Pull request review commentBash-it/bash-it

support multiple paths in pathmunge

 function local_setup {   assert_failure } +@test 'helpers: pathmunge: ensure function is defined' {+  run type -t pathmunge+  assert_line 'function'+}++@test 'helpers: pathmunge: single path' {+  new_paths='/tmp/fake-pathmunge-path'+  old_path="${PATH}"+  pathmunge "${new_paths}"+  assert_equal "${new_paths}:${old_path}" "${PATH}"+}++@test 'helpers: pathmunge: single path, with space' {+  new_paths='/tmp/fake pathmunge path'+  old_path="${PATH}"+  pathmunge "${new_paths}"+  assert_equal "${new_paths}:${old_path}" "${PATH}"+}++@test 'helpers: pathmunge: multiple paths' {+  new_paths='/tmp/fake-pathmunge-path1:/tmp/fake-pathmunge-path2'+  old_path="${PATH}"+  pathmunge "${new_paths}"+  assert_equal "${new_paths}:${old_path}" "${PATH}"+}++@test 'helpers: pathmunge: multiple paths, with space' {

It would be good to add a negative test, where you're trying to add the same path segment twice, to show that it will only be added once...

cornfeedhobo

comment created time in 17 hours

PullRequestReviewEvent

issue closedBash-it/bash-it

bash memleak

when I using the following shell to test.This shell process will abort, using gdb debug to show the following

test.sh

#!/bin/bash for(i=0,i>=0,i++) do echo $i bash -x echo.sh done

echo.sh #!/bin/bash echo ''this is test ! !"

root:~$ gdb bash test.sh GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "aarch64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from bash...done. "/root/test.sh" is not a core dump: File format not recognized (gdb) set args test.sh (gdb) r Starting program: /root/bash test.sh gdb: malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Aborted

bash version is 4.4 using the version 5.0 still have this issue. root@ubuntu:~/mailline/bash/bash$ ./bash --version GNU bash, version 4.4.0(1)-release (aarch64-unknown-linux-gnu) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

closed time in 17 hours

tiantaohuawei

issue commentBash-it/bash-it

bash memleak

I think you're trying to report an issue with the Bash shell itself - this repo is for "Bash-it" a script framework that runs in Bash.

Please open the issue on the actual Bash shell project...

tiantaohuawei

comment created time in 17 hours

pull request commentBash-it/bash-it

Fix the _command_exists function exists test use case

Nice catch - thanks!

ahmadassaf

comment created time in 17 hours

push eventBash-it/bash-it

Ahmad Assaf

commit sha 95b60098cd5802970eff9aef321ebfb2d047bbc8

Update helpers.bats Fix the `assert_success` by adding the required `run`

view details

Nils Winkler

commit sha 49a021ebd8f15681f41389fb0dbcf83c78d83e93

Merge pull request #1663 from BeameryEdge/hotfix/test_command_exists Fix the _command_exists function exists test use case

view details

push time in 17 hours

PR merged Bash-it/bash-it

Fix the _command_exists function exists test use case

On trying to run the tests locally, the @test "helpers: _command_exists function exists" failed with the following:

✗ helpers: _command_exists function exists
   (from function `_command_exists' in file test/lib/../../lib/helpers.bash, line 26,
    in test file test/lib/helpers.bats, line 24)
     `_command_exists &> /dev/null' failed
   ..../bats-assert/src/assert_success.bash: line 33: output: parameter not set

Upon examining the test/lib/helpers.bats file I found that the bats run was missing.

Bats includes a run helper that invokes its arguments as a command, saves the exit status and output into special global variables, and then returns with a 0 status code so you can continue to make assertions in your test case.

+1 -1

0 comment

1 changed file

ahmadassaf

pr closed time in 17 hours

issue closedBash-it/bash-it

Show current python venv in barbuk theme

I really enjoy using the barbuk theme for bash-it, but feel it would be super helpful if it showed the current activated python virtual environment in the prompt.

Perhaps something can be done similar to the powerline theme? (The following is copied verbatim from themes/powerline/powerline.base.bash):

function __powerline_python_venv_prompt {
  set +u
  local python_venv=""

  if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then
    python_venv="${CONDA_DEFAULT_ENV}"
    PYTHON_VENV_CHAR=${CONDA_PYTHON_VENV_CHAR}
  elif [[ -n "${VIRTUAL_ENV}" ]]; then
    python_venv=$(basename "${VIRTUAL_ENV}")
  fi

  [[ -n "${python_venv}" ]] && echo "${PYTHON_VENV_CHAR}${python_venv}|${PYTHON_VENV_THEME_PROMPT_COLOR}"
}

closed time in 17 hours

8F3E

issue commentBash-it/bash-it

Show current python venv in barbuk theme

Closed in #1661

8F3E

comment created time in 17 hours

push eventBash-it/bash-it

8F3E

commit sha 185257e9715d3db339e3e616d9ca0ed09a708565

Detect python venv and show in prompt

view details

8F3E

commit sha 43dfe23d102eda5e862615e57f6f81fa5ebdcdf2

Declare python_venv as a local variable

view details

Nils Winkler

commit sha d1a00edf1cf8316a0b9bba21edb1f948cfc4120c

Merge pull request #1661 from 8F3E/barbuk-python-venv Detect python venv and show in prompt

view details

push time in 17 hours

PR merged Bash-it/bash-it

Detect python venv and show in prompt

Fix for #1660.

Currently the barbuk theme doesn't show the activated python virtual environment in the prompt.

This PR uses modified code from the powerline theme to add that functionality.

+9 -2

0 comment

1 changed file

8F3E

pr closed time in 17 hours

PullRequestReviewEvent

Pull request review commentBash-it/bash-it

Detect python venv and show in prompt

 function _prompt {         ssh_info="${bold_blue}\u${bold_orange}@${cyan}$host ${bold_orange}in"     fi -    PS1="\\n${ssh_info} ${purple}$(scm_char)${dir_color}\\w${normal}$(scm_prompt_info)${exit_code}"+    # Detect python venv+    if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then+        python_venv="${CONDA_DEFAULT_ENV}"+    elif [[ -n "${VIRTUAL_ENV}" ]]; then+        python_venv=$(basename "${VIRTUAL_ENV}")+    fi++    PS1="\\n${ssh_info} ${python_venv} ${purple}$(scm_char)${dir_color}\\w${normal}$(scm_prompt_info)${exit_code}"

I think it's OK to leave it as is - if people are requesting it to be optional, we can still change that later.

8F3E

comment created time in 17 hours

PullRequestReviewEvent

push eventnwinkler/dotfiles

Nils Winkler

commit sha dfa26fe359436e2eee2da6206e31e3f898b5e64a

Fixed dirs

view details

push time in 3 days

Pull request review commentBash-it/bash-it

Adding support for BASH_IT_COLORSCHEME variable + colorschemes

 You can see theme screenshots on [wiki/Themes](https://github.com/Bash-it/bash-i  **NOTE**: Bash-it and some themes use UTF-8 characters, so to avoid strange behavior in your terminal, set your locale to `LC_ALL=en_US.UTF-8` or the equivalent to your language if it isn't American English. +### Color Schemes++In addition to the several dozen themes, you can alter the coloring of the prompt components using an optional color scheme. The color scheme definitions are located in `$BASH_IT/colorschemes` folder, and follow a naming convention `<name>.colorscheme.bash`. You can set the color scheme with `BASH_IT_COLORSCHEME` variable, by assigning it the `<name>` portion of the color scheme filename.++#### Why use color schema? 

@kigster Can you please address the wording? Let's use scheme consistently.

kigster

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentBash-it/bash-it

Detect python venv and show in prompt

 function _prompt {         ssh_info="${bold_blue}\u${bold_orange}@${cyan}$host ${bold_orange}in"     fi -    PS1="\\n${ssh_info} ${purple}$(scm_char)${dir_color}\\w${normal}$(scm_prompt_info)${exit_code}"+    # Detect python venv+    if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then+        python_venv="${CONDA_DEFAULT_ENV}"+    elif [[ -n "${VIRTUAL_ENV}" ]]; then+        python_venv=$(basename "${VIRTUAL_ENV}")+    fi++    PS1="\\n${ssh_info} ${python_venv} ${purple}$(scm_char)${dir_color}\\w${normal}$(scm_prompt_info)${exit_code}"

This looks good - my only concern is that this adds the Python venv for all users of this theme. This might not be an issue, but some people might complain about the (possibly unwanted) additional info.

I'm fine with keeping it like this, but we might need to make it optional if people don't like this change...

8F3E

comment created time in 3 days

Pull request review commentBash-it/bash-it

Detect python venv and show in prompt

 function _prompt {         ssh_info="${bold_blue}\u${bold_orange}@${cyan}$host ${bold_orange}in"     fi -    PS1="\\n${ssh_info} ${purple}$(scm_char)${dir_color}\\w${normal}$(scm_prompt_info)${exit_code}"+    # Detect python venv+    if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then+        python_venv="${CONDA_DEFAULT_ENV}"

You should probably declare the python_venv variable as a local, similar to the other variables. Using an undeclared variable might cause warnings/errors.

See line #69 for an example.

8F3E

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventnwinkler/bash-it

Noah Gorny

commit sha 91b6561e93a35fa4aefe19c408073d599676c917

gitstatus: Add informative warning in case dir is not found

view details

Nils Winkler

commit sha 03afc5f0469c8c2117b7d7e41561a2d4abc9636d

Merge pull request #1656 from NoahGorny/add-warning-to-gitstatus gitstatus: Add informative warning in case dir is not found

view details

Oliver Ruben Albertini

commit sha ba02955340e84bff4f6d90883eafdcfab341c9e2

hg SCM_CHANGE: prevent hexdump squeezing hexdump by default will replace any repeated groups with an asterisk and a newline, which breaks prompts. This can be disabled with the `-v` flag. For example: ``` printf 'aac' | hexdump -e '1/1 "%02x"' 61* 63 printf 'abc' | hexdump -e '1/1 "%02x"' 616263 printf 'aac' | hexdump -ve '1/1 "%02x"' 616163 ```

view details

Nils Winkler

commit sha 7dd5b3a67fa6cb670915c72566a4b7847647f1cd

Merge pull request #1658 from oliverralbertini/stop-hexdump-squeezing hg SCM_CHANGE: prevent hexdump squeezing

view details

cornfeedhobo

commit sha f40bfa80f199cfe7978eb031be04d84dd26b6144

system completion nitpicks - General cleanup of system completion - Use homebrew's completion loading script instead - Deprecate completions covered by system - Adjust load priority of brew to happen after system

view details

Nils Winkler

commit sha 4365fa8d690deb4dd46bf3dc354a4745eab3a3b8

Merge pull request #1641 from cornfeedhobo/system-completion-nitpick System completion nitpick

view details

Nils Winkler

commit sha 2e2094fcec341e8e1200b1ea456e0920c0191e99

Merge remote-tracking branch 'upstream/master' into master

view details

push time in 3 days

push eventBash-it/bash-it

cornfeedhobo

commit sha f40bfa80f199cfe7978eb031be04d84dd26b6144

system completion nitpicks - General cleanup of system completion - Use homebrew's completion loading script instead - Deprecate completions covered by system - Adjust load priority of brew to happen after system

view details

Nils Winkler

commit sha 4365fa8d690deb4dd46bf3dc354a4745eab3a3b8

Merge pull request #1641 from cornfeedhobo/system-completion-nitpick System completion nitpick

view details

push time in 3 days

PR merged Bash-it/bash-it

System completion nitpick

This was inspired from the conversation over at #1635

  • Prefer the brew/bash provided wrapper (/usr/local/etc/profile.d/bash-completion.sh) when loading bash-completion@2
  • Remove completions that should be utilizing system and notify the user through doctor
+43 -42

4 comments

4 changed files

cornfeedhobo

pr closed time in 3 days

PullRequestReviewEvent

issue commentBash-it/bash-it

some ssh clients have problem wrapping the line when cursor reaches the end of screen

Thanks for reporting this! Not sure what to do about it at the moment - I don't have a Windows environment to test this with. It works fine on my Mac/Linux setup from what I remember.

BTW: The posted snippet shows that you're using the bobby theme - the screenshot and text show Powerline...

ctodobom

comment created time in 5 days

Pull request review commentBash-it/bash-it

System completion nitpick

 # Loads the system's Bash completion modules. # If Homebrew is installed (OS X), its Bash completion modules are loaded. -if [ -f /etc/bash_completion ]; then-  . /etc/bash_completion+if [[ -r /etc/bash_completion ]] ; then

Ah, right, got it. Can we maybe turn it into an elif (in line 12) so that only one of them gets executed? At the moment, it's loading things twice if you have the completion script in both places...

cornfeedhobo

comment created time in 5 days

PullRequestReviewEvent

pull request commentBash-it/bash-it

hg SCM_CHANGE: prevent hexdump squeezing

Thanks!

oliverralbertini

comment created time in 5 days

push eventBash-it/bash-it

Oliver Ruben Albertini

commit sha ba02955340e84bff4f6d90883eafdcfab341c9e2

hg SCM_CHANGE: prevent hexdump squeezing hexdump by default will replace any repeated groups with an asterisk and a newline, which breaks prompts. This can be disabled with the `-v` flag. For example: ``` printf 'aac' | hexdump -e '1/1 "%02x"' 61* 63 printf 'abc' | hexdump -e '1/1 "%02x"' 616263 printf 'aac' | hexdump -ve '1/1 "%02x"' 616163 ```

view details

Nils Winkler

commit sha 7dd5b3a67fa6cb670915c72566a4b7847647f1cd

Merge pull request #1658 from oliverralbertini/stop-hexdump-squeezing hg SCM_CHANGE: prevent hexdump squeezing

view details

push time in 5 days

PR merged Bash-it/bash-it

hg SCM_CHANGE: prevent hexdump squeezing

hexdump by default will replace any repeated groups with an asterisk and a newline, which breaks prompts. This can be disabled with the -v flag. For example:

printf 'aac' | hexdump -e '1/1 "%02x"'
61*
63
printf 'abc' | hexdump -e '1/1 "%02x"'
616263
printf 'aac' | hexdump -ve '1/1 "%02x"'
616163
+1 -1

0 comment

1 changed file

oliverralbertini

pr closed time in 5 days

push eventnwinkler/dotfiles

Nils Winkler

commit sha 24a8b921eecfcb9621a6dca61bd1a9a7723fa893

Cleaned up Docker usage and a couple of others

view details

push time in 12 days

pull request commentBash-it/bash-it

ensure go and goenv play well together

I had a look as well, but drawing a blank here... It feels like the path handling is not happening at all. Is there anything in the go plugin that exits early when it's running in the CI environment? I mean is go not installed there or something like that...

cornfeedhobo

comment created time in 15 days

pull request commentBash-it/bash-it

System completion nitpick

Thanks for including the brew completion here as well - makes sense!

cornfeedhobo

comment created time in 15 days

Pull request review commentBash-it/bash-it

System completion nitpick

 # Loads the system's Bash completion modules. # If Homebrew is installed (OS X), its Bash completion modules are loaded. -if [ -f /etc/bash_completion ]; then-  . /etc/bash_completion+if [[ -r /etc/bash_completion ]] ; then

I think this one needs to go as well, as it does the same thing as the next if, similar to how it was/is for the Homebrew case...

cornfeedhobo

comment created time in 15 days

PullRequestReviewEvent

Pull request review commentBash-it/bash-it

System completion nitpick

 # Loads the system's Bash completion modules. # If Homebrew is installed (OS X), its Bash completion modules are loaded. -if [ -f /etc/bash_completion ]; then-  . /etc/bash_completion+if [ -r /etc/bash_completion ] ; then+  # shellcheck disable=SC1091+  source /etc/bash_completion fi  # Some distribution makes use of a profile.d script to import completion.-if [ -f /etc/profile.d/bash_completion.sh ]; then-  . /etc/profile.d/bash_completion.sh+if [ -r /etc/profile.d/bash_completion.sh ] ; then+  # shellcheck disable=SC1091+  source /etc/profile.d/bash_completion.sh fi +if [ "$(uname -s)" == 'Darwin' ] && _command_exists brew ; then -if [ $(uname) = "Darwin" ] && command -v brew &>/dev/null ; then   BREW_PREFIX=$(brew --prefix) -  if [ -f "$BREW_PREFIX"/etc/bash_completion ]; then-    . "$BREW_PREFIX"/etc/bash_completion+  if [ -r "$BREW_PREFIX"/etc/bash_completion ] ; then

Didn't we want to get rid of this if? The one below should be sufficient, shouldn't it?

cornfeedhobo

comment created time in 16 days

PullRequestReviewEvent

issue commentBash-it/bash-it

Cleanup and define "base" and "general"

Good question (and sorry for the delay in getting back to you!)

I think we shouldn't remove the function, since it looks useful and we don't know how many people are using it...

Having said that, the implementation is more complex than needed, the same thing could have been achieved with an alias. The optional parameter handling is not really needed, and switching between Linux/macOS could have been done when defining the alias. This might be a candidate for moving it to an alias.

Renaming is probably a better choice, although if people are using the function, they might be confused if it's suddenly gone. Not sure what to do in this case.

cornfeedhobo

comment created time in 16 days

push eventBash-it/bash-it

Noah Gorny

commit sha 91b6561e93a35fa4aefe19c408073d599676c917

gitstatus: Add informative warning in case dir is not found

view details

Nils Winkler

commit sha 03afc5f0469c8c2117b7d7e41561a2d4abc9636d

Merge pull request #1656 from NoahGorny/add-warning-to-gitstatus gitstatus: Add informative warning in case dir is not found

view details

push time in 16 days

PR merged Bash-it/bash-it

gitstatus: Add informative warning in case dir is not found

I think we should gradually see (and encourage) more PR's like this, which in the long run will ensure there are many logs throughout bash-it

+2 -0

2 comments

1 changed file

NoahGorny

pr closed time in 16 days

pull request commentBash-it/bash-it

gitstatus: Add informative warning in case dir is not found

Yes, that's a great use case for the log functionality.

NoahGorny

comment created time in 16 days

issue commentBash-it/bash-it

Add More Themes from ohmyzsh :D

OK - what makes these themes special? Colors? Features? Other segments that are not in any of the other themes?

(I only had a brief look, but these themes look quite similar to themes that we already have in Bash-it. I'd really like to understand what specifics you're looking for...)

tbhaxor

comment created time in 19 days

issue commentBash-it/bash-it

Unusual behavioru - potentially clashing functions/aliases?

Hi, sorry for the delay - I was on vacation. Slowly working my way through the backlog now...

You might want to disable the alias-completion plugin if you have enabled that. It tries to figure out which completion functions to use for aliases, e.g. when you run gco <TAB>, it tries to run the completion for the git checkout command. This is really useful, but the implementation contains a call to eval, which can lead to strange results with aliases that invoke a function. Give that a try and see if it helps...

tigger04

comment created time in 20 days

pull request commentBash-it/bash-it

Powerline prompt section to display last command duration

Hi, sorry for the long delay (pun intended!) - I was on vacation and I'm slowly catching up with the PRs now...

I've had a look at this, sounds like a nice feature! When I tried it, I ran into an issue, though. It looks like the start time of the command is calculated from the end time of the last command.

Here's what I did - please see the screenshot:

  • Enabled the new plugin.
  • Added the duration component to the left prompt segment.
  • Ran a sleep 4 a couple of times, with different amounts of (my) wait time before running it again.

As you can see (check the time stamp in the right prompt segment), depending on the time between the commands, the output varies greatly. Before the last sleep 4, I waited more than a minute, which resulted in a display of 01m:55s for the sleep 4 execution. That doesn't seem right...

image

The other thing to note is that if we add this feature, it needs to be documented in the Powerline themes' README files, similar to the other prompt features.

clupasq

comment created time in 20 days

push eventnwinkler/bash-it

Guilherme Paula

commit sha d8a0e8444d94cef34ac3be1f7f4519d73fbf6769

[robbyrussell theme] Cleaning up bold markup after theme

view details

Nils Winkler

commit sha c5994d28f4990290fda88a39121eb5a9b451593a

Merge pull request #1655 from guilhermepaula/master [robbyrussell theme] Cleaning up bold markup after theme

view details

Nils Winkler

commit sha 8d2110ce916d28167c038e0e2b89f744d8a03ac8

Merge remote-tracking branch 'upstream/master' into master

view details

push time in 20 days

issue commentBash-it/bash-it

Add More Themes from ohmyzsh :D

Are you looking for a specific theme, or specific features in one of the themes? Instead of blindly adding more themes (we have plenty already), I'd be interested in understanding which features people are looking for.

The majority of the themes look very similar and only have minor differences from what I have seen. A lot of it comes down to personal preference - maybe we should rather look into features and then make features configurable on themes. The Powerline themes are a good example for this...

tbhaxor

comment created time in 20 days

pull request commentBash-it/bash-it

[robbyrussell theme] Cleaning up bold markup after theme

Thanks!

guilhermepaula

comment created time in 24 days

push eventBash-it/bash-it

Guilherme Paula

commit sha d8a0e8444d94cef34ac3be1f7f4519d73fbf6769

[robbyrussell theme] Cleaning up bold markup after theme

view details

Nils Winkler

commit sha c5994d28f4990290fda88a39121eb5a9b451593a

Merge pull request #1655 from guilhermepaula/master [robbyrussell theme] Cleaning up bold markup after theme

view details

push time in 24 days

PR merged Bash-it/bash-it

[robbyrussell theme] Cleaning up bold markup after theme

A fix to align with robbyrussell theme of zsh, which the command line is not bold, just the theme by itself.

+3 -4

0 comment

1 changed file

guilhermepaula

pr closed time in 24 days

push eventnwinkler/bash-it

cornfeedhobo

commit sha 97bb1fc7ba3cb49113b058a5acb9296544fb4bf2

allow the caller to pass a custom log message when the command is not found

view details

Nils Winkler

commit sha 45ae15139dfc1d3cee65d0d48e90e64093260c9d

Merge pull request #1645 from cornfeedhobo/cnf-optional-message _command_exists - custom log message

view details

Nils Winkler

commit sha 6b363879ac995c7b4cf86db7bb33206dd14a986c

Merge remote-tracking branch 'upstream/master' into master

view details

push time in a month

push eventBash-it/bash-it

cornfeedhobo

commit sha 97bb1fc7ba3cb49113b058a5acb9296544fb4bf2

allow the caller to pass a custom log message when the command is not found

view details

Nils Winkler

commit sha 45ae15139dfc1d3cee65d0d48e90e64093260c9d

Merge pull request #1645 from cornfeedhobo/cnf-optional-message _command_exists - custom log message

view details

push time in a month

PR merged Bash-it/bash-it

_command_exists - custom log message

This PR allows the caller to pass a custom log message when the command is not found.

I considered a few other approaches, so I'm open to opinions, but this seems easy enough.

Example use case:

# Load pyenv virtualenv if the plugin is installed
! _command_exists \
  "pyenv virtualenv --help" \
  "pyenv plugin 'virtualenv' is not installed - skipping" ||
    eval "$(pyenv virtualenv-init - bash)"
$ bash-it doctor
...
 WARN: plugin: pyenv: pyenv plugin 'virtualenv' is not installed - skipping
...
+3 -1

7 comments

1 changed file

cornfeedhobo

pr closed time in a month

pull request commentBash-it/bash-it

_command_exists - custom log message

I'll merge this PR now, since it looks good to me - we can add/refactor the functions and documentation separately.

cornfeedhobo

comment created time in a month

pull request commentBash-it/bash-it

_command_exists - custom log message

That paragraph looks good - thanks for writing that up. It could serve as a starting point for documenting the available functions in more detail.

I agree that there should be some separation for functions between internal and external APIs, like you described.

cornfeedhobo

comment created time in a month

push eventnwinkler/dotfiles

Nils Winkler

commit sha 2240d95a19d0640cfb43a0c671da53e1a6228309

Updated a couple of settings

view details

push time in 2 months

Pull request review commentBash-it/bash-it

System completion nitpick

 # Loads the system's Bash completion modules. # If Homebrew is installed (OS X), its Bash completion modules are loaded. -if [ -f /etc/bash_completion ]; then-  . /etc/bash_completion+if [ -r /etc/bash_completion ] ; then+  # shellcheck disable=SC1091+  source /etc/bash_completion fi  # Some distribution makes use of a profile.d script to import completion.-if [ -f /etc/profile.d/bash_completion.sh ]; then-  . /etc/profile.d/bash_completion.sh+if [ -r /etc/profile.d/bash_completion.sh ] ; then+  # shellcheck disable=SC1091+  source /etc/profile.d/bash_completion.sh fi  -if [ $(uname) = "Darwin" ] && command -v brew &>/dev/null ; then-  BREW_PREFIX=$(brew --prefix)+if [ "$(uname)" == "Darwin" ] ; then -  if [ -f "$BREW_PREFIX"/etc/bash_completion ]; then-    . "$BREW_PREFIX"/etc/bash_completion+  # XCode installs git's completion files to a non-standard place+  # Note: This should be loaded before brew's completion folder is parsed,+  #       multiple tools glob on to this completion.+  _git_comp='/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash'+  if _command_exists git && ! complete -p git &>/dev/null && [ -r "$_git_comp" ] ; then+    # shellcheck disable=SC1090+    source "$_git_comp"   fi+  unset _git_comp - # homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path-  if [ "${BASH_VERSINFO}" -ge 4 ] && [ -f "$BREW_PREFIX"/share/bash-completion/bash_completion ]; then-    export BASH_COMPLETION_COMPAT_DIR="$BREW_PREFIX"/etc/bash_completion.d-    . "$BREW_PREFIX"/share/bash-completion/bash_completion+  if _command_exists brew ; then+    BREW_PREFIX=$(brew --prefix)++    if [ -r "$BREW_PREFIX"/etc/bash_completion ] ; then+      # shellcheck disable=SC1090+      source "$BREW_PREFIX"/etc/bash_completion+    fi++    # homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path+    if [ -r "$BREW_PREFIX"/etc/profile.d/bash_completion.sh ] ; then

@cornfeedhobo I still think we should get rid of one of the if checks as described above. Let's keep the $BREW_PREFIX/etc/profile.d/bash_completion.sh and remove the $BREW_PREFIX/etc/bash_completion check/source...

cornfeedhobo

comment created time in 2 months

pull request commentBash-it/bash-it

System completion nitpick

Yes, it looks like these paths are there for historical reasons. One thing I've learned while maintaining this project is that if we take something like that away, there's a good chance that someone is still using that location and will complain...

So unless having these additional paths really hurts, I'd vote for leaving them in there - maybe adding a comment to note that they are there for historical purposes.

cornfeedhobo

comment created time in 2 months

push eventnwinkler/bash-it

Nils Winkler

commit sha 230bafd0d1e4a48d92e779f16a2cc756e4b505d5

Fixed OS comparison for macOS This was always failing on macOS instead of working there... See #1635 for the original commit that introduced this issue.

view details

Nils Winkler

commit sha 9cc9bd59326381a95d0a1108f0e02a3c81039485

Merge pull request #1650 from nwinkler/git-completion-darwin-fix Fixed OS comparison for macOS

view details

Nils Winkler

commit sha fc1e3ebe6ede56497ed4ba348ce94e6d5b7ccf8a

Merge remote-tracking branch 'upstream/master' into master

view details

push time in 2 months

delete branch nwinkler/bash-it

delete branch : git-completion-darwin-fix

delete time in 2 months

push eventBash-it/bash-it

Nils Winkler

commit sha 230bafd0d1e4a48d92e779f16a2cc756e4b505d5

Fixed OS comparison for macOS This was always failing on macOS instead of working there... See #1635 for the original commit that introduced this issue.

view details

Nils Winkler

commit sha 9cc9bd59326381a95d0a1108f0e02a3c81039485

Merge pull request #1650 from nwinkler/git-completion-darwin-fix Fixed OS comparison for macOS

view details

push time in 2 months

PR merged Bash-it/bash-it

Fixed OS comparison for macOS

This was always failing on macOS instead of working there...

See #1635 for the original commit that introduced this issue. We somehow missed this, @cornfeedhobo...

+1 -1

0 comment

1 changed file

nwinkler

pr closed time in 2 months

PR opened Bash-it/bash-it

Fixed OS comparison for macOS

This was always failing on macOS instead of working there...

See #1635 for the original commit that introduced this issue. We somehow missed this, @cornfeedhobo...

+1 -1

0 comment

1 changed file

pr created time in 2 months

create barnchnwinkler/bash-it

branch : git-completion-darwin-fix

created branch time in 2 months

push eventnwinkler/bash-it

Kan Li

commit sha 41084ee67807fef423cad2f2fab25ccfce5a3d0e

Fix error "bash: _git_bash_completion_found: command not found..."

view details

Nils Winkler

commit sha 24ed7c6b094c92bb3d82b6bbb32723f412074a88

Merge pull request #1649 from likan999/patch-1 Fix error "bash: _git_bash_completion_found: command not found..."

view details

Nils Winkler

commit sha cb968d2309fd7e069db01bfb5dee1c7e5d6c95af

Merge remote-tracking branch 'upstream/master' into master

view details

push time in 2 months

push eventBash-it/bash-it

Kan Li

commit sha 41084ee67807fef423cad2f2fab25ccfce5a3d0e

Fix error "bash: _git_bash_completion_found: command not found..."

view details

Nils Winkler

commit sha 24ed7c6b094c92bb3d82b6bbb32723f412074a88

Merge pull request #1649 from likan999/patch-1 Fix error "bash: _git_bash_completion_found: command not found..."

view details

push time in 2 months

pull request commentBash-it/bash-it

Fix error "bash: _git_bash_completion_found: command not found..."

Good catch! Thanks!

likan999

comment created time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

Agreed - removing old/unused code that is no longer required feels good!

cornfeedhobo

comment created time in 2 months

push eventnwinkler/bash-it

cornfeedhobo

commit sha 42e9017df3abd2db630f27c34721c2156c4e6c56

simplify git completion to use system-provided completions only (#1635) * simplify git completion to use system-provided completions only * support ubuntu git completion * only search non-system paths * only operate on macos. * no need to return 1 in a plugin * make alias test happy * make alias test happy * make alias test happy * pass exit code when capturing expected errors * slightly more understandable code structure * make better use of the new logging feature

view details

Nils Winkler

commit sha 4b3ff246978be4e23388dd57895488e5ee4d7d2e

Merge remote-tracking branch 'upstream/master' into master

view details

push time in 2 months

push eventBash-it/bash-it

cornfeedhobo

commit sha 42e9017df3abd2db630f27c34721c2156c4e6c56

simplify git completion to use system-provided completions only (#1635) * simplify git completion to use system-provided completions only * support ubuntu git completion * only search non-system paths * only operate on macos. * no need to return 1 in a plugin * make alias test happy * make alias test happy * make alias test happy * pass exit code when capturing expected errors * slightly more understandable code structure * make better use of the new logging feature

view details

push time in 2 months

PR merged Bash-it/bash-it

simplify git completion to use system-provided completions only

This stops embedding a copied work, and it was broken anyways. I've only tested these paths on two distros, so suggestions are welcome!

Partially addresses #512

+32 -3379

22 comments

1 changed file

cornfeedhobo

pr closed time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

Awesome - thanks for working through this!

cornfeedhobo

comment created time in 2 months

push eventnwinkler/dotfiles

Nils Winkler

commit sha 5638c8f761910834f23ac3f0837b57c8f49ed88a

Added rebase setting for Git

view details

push time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

BTW: This works consistently for me on both macOS and Linux (tested with Ubuntu Xenial64 in Vagrant):

[[ "$(uname -s)" == 'Darwin' ]] || return 0

The return 0 seems to make the difference.

With -eq, the comparison never works (this is on Ubuntu):

> [[ "$(uname -s)" -eq 'Darwin' ]] || echo "Foo"

> [[ "$(uname -s)" -eq 'Linux' ]] || echo "Foo"

> [[ "$(uname -s)" == 'Darwin' ]] || echo "Foo"
Foo
cornfeedhobo

comment created time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

Thanks for working through this! The other variations we have for checking for OS are these:

  • Checking for the $OSTYPE env variable (if/fi with double brackets): https://github.com/Bash-it/bash-it/blob/f120554755d21fb8413aa0aae70ceda051cbbeb9/plugins/available/gif.plugin.bash#L39
  • Checking for uname with == (if/fi with single brackets): https://github.com/Bash-it/bash-it/blob/f120554755d21fb8413aa0aae70ceda051cbbeb9/completion/available/system.completion.bash#L16
  • Lots of case statements for $OSTYPE, e.g. here: https://github.com/Bash-it/bash-it/blob/f120554755d21fb8413aa0aae70ceda051cbbeb9/aliases/available/vim.aliases.bash#L12-L13

Plus some other variations. Not sure why your earlier version was failing. The if/fi seems to be important, different than the || return...

cornfeedhobo

comment created time in 2 months

pull request commentnwinkler/atom-keyboard-shortcuts

Update README.md

Thanks!

shauryak

comment created time in 2 months

push eventnwinkler/atom-keyboard-shortcuts

shauryak

commit sha 0b5760f5796785dfb49139b94dfd758caf8e451a

Update README.md Fold/Unfold Windows and Linux are Ctrl+Alt+[ and Ctrl+Alt+]

view details

Nils Winkler

commit sha 09cf6832d44e5c7911de66b33be1703f939f6529

Merge pull request #35 from shauryak/patch-1 Update README.md

view details

push time in 2 months

PR merged nwinkler/atom-keyboard-shortcuts

Update README.md

Fold/Unfold Windows and Linux are Ctrl+Alt+[ and Ctrl+Alt+]

+1 -1

0 comment

1 changed file

shauryak

pr closed time in 2 months

push eventnwinkler/dotfiles

Nils Winkler

commit sha 60b8fd74055519ebc2041cac94b9f60f3aa56e03

Fixed font name

view details

push time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

I'll try to install a Linux VM (Docker or Vagrant) later today if I find the time...

cornfeedhobo

comment created time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

Interesting! If you take a look here, you will see that the macOS tests ran fine, it's the Linux ones that are failing now.

No errors in the log (https://travis-ci.com/github/Bash-it/bash-it/jobs/369208799#L297), but you can see that the test cases 150 and 151 are missing for some reason - it goes straight from 149 to 152. The alias-completion.plugin.bats are supposed to run there. I'm wondering whether the check for Darwin in the git completion file is causing this error for some reason.

cornfeedhobo

comment created time in 2 months

push eventnwinkler/bash-it

Nils Winkler

commit sha 03e9124edb661d2d833156628fc57ca51bc003e8

Fixed test execution

view details

Nils Winkler

commit sha f120554755d21fb8413aa0aae70ceda051cbbeb9

Merge pull request #1648 from nwinkler/fix-alias-completion-tests Fixed test execution

view details

Nils Winkler

commit sha eddd3b503ee845865ac3df076b27dcf457ed59d8

Merge remote-tracking branch 'upstream/master'

view details

push time in 2 months

delete branch nwinkler/bash-it

delete branch : fix-alias-completion-tests

delete time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

Merged #1648, can you please rebase your branch on top of that? That should hopefully do it - I did not see any other test errors so far.

cornfeedhobo

comment created time in 2 months

push eventBash-it/bash-it

Nils Winkler

commit sha 03e9124edb661d2d833156628fc57ca51bc003e8

Fixed test execution

view details

Nils Winkler

commit sha f120554755d21fb8413aa0aae70ceda051cbbeb9

Merge pull request #1648 from nwinkler/fix-alias-completion-tests Fixed test execution

view details

push time in 2 months

PR merged Bash-it/bash-it

Fixed test execution

Helps with #1635

+5 -0

0 comment

1 changed file

nwinkler

pr closed time in 2 months

PR opened Bash-it/bash-it

Fixed test execution

Helps with #1635

+5 -0

0 comment

1 changed file

pr created time in 2 months

create barnchnwinkler/bash-it

branch : fix-alias-completion-tests

created branch time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

OK, this is a tricky one... I think I found the issue, will open a PR in a moment. Here's what I did:

Noticed that one of the test runs on Travis shows an error here: https://travis-ci.com/github/Bash-it/bash-it/jobs/368318142#L240

/Users/travis/build/Bash-it/bash-it/test/plugins/../../completion/available/git.completion.bash: line 7: _command_exists: command not found
241/Users/travis/build/Bash-it/bash-it/test/plugins/../../completion/available/git.completion.bash: line 7: _command_exists: command not found

This seems to be related to the recent changes in this PR.

To find out what's causing this, I ran the tests locally - to make sure that one test is executed at a time (not in parallel), I set the test execution threads to 1:

TEST_JOBS=1 test/run 

I could see the same error in this case, and the final line read:

220 tests, 0 failures, 2 not run

Those two error messages are causing two tests to not run, now to find out which these are. I noticed that the errors show before the base.plugin.bats test cases. In the test/plugin folder, there's the alias-completion.plugin.bats before base.plugin.bats. I tried to run that:

> TEST_JOBS=1 test/run test/plugins/alias-completion.plugin.bats 
/Users/nils.winkler/.bash_it/test/plugins/../../completion/available/git.completion.bash: line 7: _command_exists: command not found
/Users/nils.winkler/.bash_it/test/plugins/../../completion/available/git.completion.bash: line 7: _command_exists: command not found

2 tests, 0 failures, 2 not run

There it is...

Will open a PR to fix this in a second.

cornfeedhobo

comment created time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

@cornfeedhobo #1647 has been merged, it fixed some error messages during the test run. Can you rebase your branch on top of this and see if it fixes the issue with this PR's build jobs?

cornfeedhobo

comment created time in 2 months

delete branch nwinkler/bash-it

delete branch : fix-search-tests-log

delete time in 2 months

push eventnwinkler/bash-it

Nils Winkler

commit sha 2f91e95af62aa88ef7fddaa6d68857db8f36cc00

Adding log library to search tests This might help with #1635.

view details

Nils Winkler

commit sha 43ea66332bdb76865359bb1755d2a61d40832279

Merge pull request #1647 from nwinkler/fix-search-tests-log Adding log library to search tests

view details

Nils Winkler

commit sha b9f1448758d8161060b1da6e9e4e5bfb2eb35e0e

Merge remote-tracking branch 'upstream/master'

view details

push time in 2 months

push eventBash-it/bash-it

Nils Winkler

commit sha 2f91e95af62aa88ef7fddaa6d68857db8f36cc00

Adding log library to search tests This might help with #1635.

view details

Nils Winkler

commit sha 43ea66332bdb76865359bb1755d2a61d40832279

Merge pull request #1647 from nwinkler/fix-search-tests-log Adding log library to search tests

view details

push time in 2 months

PR merged Bash-it/bash-it

Adding log library to search tests

This might help with #1635.

+1 -0

0 comment

1 changed file

nwinkler

pr closed time in 2 months

pull request commentBash-it/bash-it

_command_exists - custom log message

That's fine - let's merge as-is. I'll wait for #1647 and #1635 to be completed, then we can merge this one.

I'll look into adding some documentation regarding the function.

cornfeedhobo

comment created time in 2 months

pull request commentBash-it/bash-it

simplify git completion to use system-provided completions only

I can see some errors related to the new log functionality here: https://travis-ci.com/github/Bash-it/bash-it/jobs/368158047#L283

I've tried to fix them in #1647 - let's see if that helps. I'll wait for the tests in #1647 to complete - if that fixes the error messages, you can try to rebase your branch on that.

cornfeedhobo

comment created time in 2 months

PR opened Bash-it/bash-it

Adding log library to search tests

This might help with #1635.

+1 -0

0 comment

1 changed file

pr created time in 2 months

create barnchnwinkler/bash-it

branch : fix-search-tests-log

created branch time in 2 months

more