lib/helpers: quotes for consistency
Quote some parameter uses that don't strictly require it, but since Bash needs so many quotes everywhere else my brain worms feel better when these are quoted too. lib/helpers: simplify some quote escapespull/1934/head
parent
dfc3fa4339
commit
0f0093dd4b
|
|
@ -119,7 +119,7 @@ function bash-it() {
|
||||||
shift
|
shift
|
||||||
local func
|
local func
|
||||||
|
|
||||||
case $verb in
|
case "$verb" in
|
||||||
show)
|
show)
|
||||||
func="_bash-it-$component"
|
func="_bash-it-$component"
|
||||||
;;
|
;;
|
||||||
|
|
@ -487,7 +487,7 @@ function _bash-it-profile-save() {
|
||||||
local name="${1:-}"
|
local name="${1:-}"
|
||||||
while [[ -z "$name" ]]; do
|
while [[ -z "$name" ]]; do
|
||||||
read -r -e -p "Please enter the name of the profile to save: " name
|
read -r -e -p "Please enter the name of the profile to save: " name
|
||||||
case $name in
|
case "$name" in
|
||||||
"")
|
"")
|
||||||
echo -e "${echo_orange?}Please choose a name.${echo_reset_color?}"
|
echo -e "${echo_orange?}Please choose a name.${echo_reset_color?}"
|
||||||
;;
|
;;
|
||||||
|
|
@ -499,12 +499,12 @@ function _bash-it-profile-save() {
|
||||||
|
|
||||||
local profile_path="${BASH_IT}/profiles/${name}.bash_it" RESP
|
local profile_path="${BASH_IT}/profiles/${name}.bash_it" RESP
|
||||||
if [[ -s "$profile_path" ]]; then
|
if [[ -s "$profile_path" ]]; then
|
||||||
echo -e "${echo_yellow?}Profile \"$name\" already exists.${echo_reset_color?}"
|
echo -e "${echo_yellow?}Profile '$name' already exists.${echo_reset_color?}"
|
||||||
while true; do
|
while true; do
|
||||||
read -r -e -n 1 -p "Would you like to overwrite existing profile? [y/N] " RESP
|
read -r -e -n 1 -p "Would you like to overwrite existing profile? [y/N] " RESP
|
||||||
case $RESP in
|
case "$RESP" in
|
||||||
[yY])
|
[yY])
|
||||||
echo -e "${echo_green?}Overwriting profile \"$name\"...${echo_reset_color?}"
|
echo -e "${echo_green?}Overwriting profile '$name'...${echo_reset_color?}"
|
||||||
rm "$profile_path"
|
rm "$profile_path"
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
|
|
@ -519,14 +519,13 @@ function _bash-it-profile-save() {
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local something_exists subdirectory
|
local something_exists subdirectory component_exists f enabled_file
|
||||||
echo "# This file is auto generated by Bash-it. Do not edit manually!" > "$profile_path"
|
echo "# This file is auto generated by Bash-it. Do not edit manually!" > "$profile_path"
|
||||||
for subdirectory in "plugins" "completion" "aliases"; do
|
for subdirectory in "plugins" "completion" "aliases"; do
|
||||||
local component_exists="" f
|
|
||||||
echo "Saving $subdirectory configuration..."
|
echo "Saving $subdirectory configuration..."
|
||||||
for f in "${BASH_IT}/$subdirectory/available/"*.bash; do
|
for f in "${BASH_IT}/$subdirectory/available"/*.bash; do
|
||||||
if _bash-it-component-item-is-enabled "$f"; then
|
if _bash-it-component-item-is-enabled "$f"; then
|
||||||
if [[ -z "$component_exists" ]]; then
|
if [[ -z "${component_exists:-}" ]]; then
|
||||||
# This is the first component of this type, print the header
|
# This is the first component of this type, print the header
|
||||||
component_exists="yes"
|
component_exists="yes"
|
||||||
something_exists="yes"
|
something_exists="yes"
|
||||||
|
|
@ -917,7 +916,7 @@ function _help-aliases() {
|
||||||
_example '$ alias-help git'
|
_example '$ alias-help git'
|
||||||
|
|
||||||
if [[ -n "$1" ]]; then
|
if [[ -n "$1" ]]; then
|
||||||
case $1 in
|
case "$1" in
|
||||||
custom)
|
custom)
|
||||||
alias_path='custom.aliases.bash'
|
alias_path='custom.aliases.bash'
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue