13 Commits

Author SHA1 Message Date
Noah Gorny
1ffbc85a62 Merge pull request #2138 from eviweb/fix-projects-plugin-regression
fix projects plugin regression
2022-03-16 21:54:51 +02:00
Noah Gorny
60c4c0b598 Merge pull request #2132 from NoahGorny/add-default-editor-nano
general: Add default nano editor for the edit alias
2022-03-16 21:47:02 +02:00
Eric Villard
088212fd32 fix projects plugin regression
This regression was introduced in ea2002a.

Before this commit, when the provided project was unique under all the
project paths, the command automatically change the directory to it.
Currently this is no more the case.
If there are many project paths set, then the project path menu is shown
at every call.
This PR solves this issue.

Signed-off-by: Eric Villard <dev@eviweb.fr>
2022-03-16 08:43:52 +01:00
Noah Gorny
d1b831a92d Merge pull request #2119 from BarbUk/fix/command_duration_precision
Fix/command duration precision
2022-03-14 11:59:27 +02:00
Noah Gorny
69407018a7 Merge pull request #2129 from tbhaxor/fix/awscli-completion
Clean awscli completion
2022-03-14 11:55:44 +02:00
Noah Gorny
a481ff41ab general: Add default nano editor for the edit alias 2022-03-14 11:20:40 +02:00
Noah Gorny
7cc2ced3b9 Merge pull request #2122 from BarbUk/fix/grep_path
Fix grep path when a grep alias exists
2022-03-14 10:58:48 +02:00
Gurkirat Singh
66fbed7f6f fix (completion): format awscli 2022-03-13 05:21:13 +05:30
Gurkirat Singh
6b0ca17df0 improve (lint): add awscli.completion.bash in clean_files.txt 2022-03-13 05:20:57 +05:30
BarbUk
23efb39fb0 Fix grep path when a grep alias exists 2022-03-11 09:08:58 +01:00
BarbUk
e1ddf6e311 Fix dynamic clock icon (#2120)
* Fix dynamic clock icon

* Use printf variable scope

* shfmt do not like spaces
2022-03-09 22:59:48 +02:00
BarbUk
634c1f8c18 Fix spacing in string output 2022-03-09 11:01:53 +01:00
BarbUk
4686ce1f12 Fix precision to use deciseconds instead of nanoseconds 2022-03-09 09:38:16 +01:00
6 changed files with 14 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ fi
alias c='clear' alias c='clear'
alias cls='clear' alias cls='clear'
alias edit='${EDITOR:-${ALTERNATE_EDITOR?}}' alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}'
alias pager='${PAGER:=less}' alias pager='${PAGER:=less}'
alias q='exit' alias q='exit'

View File

@@ -33,6 +33,7 @@ lint_clean_files.sh
# #
completion/available/apm.completion.bash completion/available/apm.completion.bash
completion/available/awless.completion.bash completion/available/awless.completion.bash
completion/available/awscli.completion.bash
completion/available/bash-it.completion.bash completion/available/bash-it.completion.bash
completion/available/brew.completion.bash completion/available/brew.completion.bash
completion/available/cargo.completion.bash completion/available/cargo.completion.bash

View File

@@ -1,6 +1,5 @@
# shellcheck shell=bash # shellcheck shell=bash
if _command_exists aws_completer if _command_exists aws_completer; then
then
complete -C "$(command -v aws_completer)" aws complete -C "$(command -v aws_completer)" aws
fi fi

View File

@@ -11,7 +11,10 @@ function _command_duration_pre_exec() {
} }
function _dynamic_clock_icon { function _dynamic_clock_icon {
local -i clock_hand=$(((${1:-${SECONDS}} % 12) + 90)) local clock_hand
# clock hand value is between 90 and 9b in hexadecimal.
# so between 144 and 155 in base 10.
printf -v clock_hand '%x' $(((${1:-${SECONDS}} % 12) + 144))
printf -v 'COMMAND_DURATION_ICON' '%b' "\xf0\x9f\x95\x$clock_hand" printf -v 'COMMAND_DURATION_ICON' '%b' "\xf0\x9f\x95\x$clock_hand"
} }
@@ -22,9 +25,11 @@ function _command_duration() {
local -i minutes=0 seconds=0 deciseconds=0 local -i minutes=0 seconds=0 deciseconds=0
local -i command_start_seconds="${command_start%.*}" local -i command_start_seconds="${command_start%.*}"
local -i command_start_deciseconds=$((10#${command_start##*.})) local -i command_start_deciseconds=$((10#${command_start##*.}))
command_start_deciseconds="${command_start_deciseconds:0:1}"
local current_time="${EPOCHREALTIME:-$SECONDS}" local current_time="${EPOCHREALTIME:-$SECONDS}"
local -i current_time_seconds="${current_time%.*}" local -i current_time_seconds="${current_time%.*}"
local -i current_time_deciseconds="$((10#${current_time##*.}))" local -i current_time_deciseconds="$((10#${current_time##*.}))"
current_time_deciseconds="${current_time_deciseconds:0:1}"
if [[ "${command_start_seconds:-0}" -gt 0 ]]; then if [[ "${command_start_seconds:-0}" -gt 0 ]]; then
# seconds # seconds

View File

@@ -62,13 +62,13 @@ function _bash-it-array-dedup() {
# Outputs a full path of the grep found on the filesystem # Outputs a full path of the grep found on the filesystem
function _bash-it-grep() { function _bash-it-grep() {
: "${BASH_IT_GREP:=$(type -p egrep || type -p grep)}" : "${BASH_IT_GREP:=$(type -P egrep || type -P grep)}"
printf "%s" "${BASH_IT_GREP:-/usr/bin/grep}" printf "%s" "${BASH_IT_GREP:-/usr/bin/grep}"
} }
# Runs `grep` with extended regular expressions # Runs `grep` with extended regular expressions
function _bash-it-egrep() { function _bash-it-egrep() {
: "${BASH_IT_GREP:=$(type -p egrep || type -p grep)}" : "${BASH_IT_GREP:=$(type -P egrep || type -P grep)}"
"${BASH_IT_GREP:-/usr/bin/grep}" -E "$@" "${BASH_IT_GREP:-/usr/bin/grep}" -E "$@"
} }

View File

@@ -21,7 +21,7 @@ function pj() {
# with the same name in project directories # with the same name in project directories
IFS=':' read -ra dests <<< "${BASH_IT_PROJECT_PATHS?${FUNCNAME[0]}: project working folders must be configured}" IFS=':' read -ra dests <<< "${BASH_IT_PROJECT_PATHS?${FUNCNAME[0]}: project working folders must be configured}"
for d in "${!dests[@]}"; do for d in "${!dests[@]}"; do
if [[ ! -d "${dests[d]}" ]]; then if [[ ! -d "${dests[d]}/${proj}" ]]; then
unset 'dests[d]' unset 'dests[d]'
fi fi
done done