Skip to content

Commit 602bf50

Browse files
v1.2.2: fix more interactivity hangups
1 parent 1bff018 commit 602bf50

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.name-safe-in-bash-help-information

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== SUMMARY ===
22

3-
version: 1.2.1 | home: https://github.com/makesourcenotcode/name-safe-in-bash
3+
version: 1.2.2 | home: https://github.com/makesourcenotcode/name-safe-in-bash
44

55
Help choosing Bash alias and function names that WON'T come back to bite you
66
later!
@@ -71,6 +71,7 @@ may be spun up as another project.
7171

7272
=== CHANGELOG ===
7373

74+
v1.2.2: fix more interactivity hangups
7475
v1.2.1: minor documentation fix
7576
v1.2.0: fix package manager interactivity hangups
7677
v1.1.2: minor documentation improvement

name-safe-in-bash

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,22 @@ output_commands_found_in_path(){
1515
for directory in `echo $PATH | sed 's/:/ /g'`; do
1616
ls -A $directory 2>/dev/null; done;}
1717

18+
assert_command_exists(){ type "$1" >/dev/null 2>&1;}
19+
1820
output_name_if_known_to_dnf(){
19-
dnf --assumeno provides "$1" >/dev/null 2>&1 && echo "$1";}
21+
assert_command_exists dnf &&
22+
dnf --assumeno provides "$1" >/dev/null 2>&1 &&
23+
echo "$1";}
2024

2125
output_name_if_known_to_yum(){
22-
yum --assumeno provides "$1" >/dev/null 2>&1 && echo "$1";}
26+
assert_command_exists yum &&
27+
yum --assumeno provides "$1" >/dev/null 2>&1 &&
28+
echo "$1";}
2329

2430
output_name_if_known_to_zypper(){
25-
zypper --non-interactive what-provides "$1" >/dev/null 2>&1 && echo "$1";}
31+
assert_command_exists zypper &&
32+
zypper --non-interactive what-provides "$1" >/dev/null 2>&1 &&
33+
echo "$1";}
2634

2735
output_names_for_edit_distance_comparision() {
2836
local -r proposed_name="$1"

0 commit comments

Comments
 (0)