You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prevent collisions with built-ins and user functions, all
bash-lib functions now have the prefix bl_. This is a major
breaking change and will be released as v2.0.0
Copy file name to clipboardexpand all lines: README.md
+31-20
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ files within it's directory.
113
113
<td>Functions relating to file and path handling
114
114
<td>
115
115
<ol>
116
-
<li><b>abs_path</b>: Ensure a path is absolute</li>
116
+
<li><b>bl_abs_path</b>: Ensure a path is absolute</li>
117
117
</ol>
118
118
</td>
119
119
</tr>
@@ -122,24 +122,27 @@ files within it's directory.
122
122
<td>Git helpers</td>
123
123
<td>
124
124
<ol>
125
-
<li><b>repo_root</b>: Find the root of the current git repo.</li>
126
-
<li><b>all_files_in_repo</b>: List files tracked by git.</li>
127
-
<li><b>remote_latest_tag</b>: Returns the symbolic name of the latest tag from a remote.</li>
128
-
<li><b>remote_latest_tagged_commit</b>: Returns the SHA of the most recently tagged commit in a remote repo (<code>tag^{}</code>).</li>
129
-
<li><b>remote_sha_for_ref</b>: Returns the SHA for a given ref from a named remote.</li>
130
-
<li><b>remote_tag_for_sha</b>: Returns the tag corresponding to a SHA from a named remote - if there is one.</li>
131
-
<li><b>tracked_files_excluding_subtrees</b>: List files tracked by git, but excluding any files that are in paths listed in <code>.gittrees</code>.</li>
132
-
<li><b>cat_gittrees</b>: Returns the contents of .gittrees from the top level of the repo, excluding any comments. Fails if .gittrees is not present.</li>
125
+
<li><b>bl_repo_root</b>: Find the root of the current git repo.</li>
126
+
<li><b>bl_all_files_in_repo</b>: List files tracked by git.</li>
127
+
<li><b>bl_remote_latest_tag</b>: Returns the symbolic name of the latest tag from a remote.</li>
128
+
<li><b>bl_remote_latest_tagged_commit</b>: Returns the SHA of the most recently tagged commit in a remote repo (<code>tag^{}</code>).</li>
129
+
<li><b>bl_remote_sha_for_ref</b>: Returns the SHA for a given ref from a named remote.</li>
130
+
<li><b>bl_remote_tag_for_sha</b>: Returns the tag corresponding to a SHA from a named remote - if there is one.</li>
131
+
<li><b>bl_tracked_files_excluding_subtrees</b>: List files tracked by git, but excluding any files that are in paths listed in <code>.gittrees</code>.</li>
132
+
<li><b>bl_cat_gittrees</b>: Returns the contents of .gittrees from the top level of the repo, excluding any comments. Fails if .gittrees is not present.</li>
133
133
</ol>
134
134
</td>
135
135
</tr>
136
136
<td><a href="helpers/lib">helpers</a></td>
137
137
<td>Bash scripting helpers</td>
138
138
<td>
139
139
<ol>
140
-
<li><b>die</b>: print message and exit 1</li>
141
-
<li><b>spushd/spopd</b>: Safe verisons of pushd & popd that call die if the push/pop fails, they also drop stdout. </li>
142
-
<li><b>retry</b>: Retry a command until it succeeds up to a user specified maximum number of attempts. Escalating delay between attempts.</li>
140
+
<li><b>bl_die</b>: print message and exit 1</li>
141
+
<li><b>bl_spushd/bl_spopd</b>: Safe verisons of pushd & popd that call die if the push/pop fails, they also drop stdout. </li>
142
+
<li><b>bl_is_num</b>: Check if a value is a number via regex</li>
143
+
<li><b>bl_retry</b>: Retry a command until it succeeds up to a user specified maximum number of attempts. Escalating delay between attempts.</li>
144
+
<li><b>bl_retry_constant</b>: Retry a command until it succeeds with a
145
+
constant delay between attempts</li>
143
146
</ol>
144
147
</td>
145
148
</tr>
@@ -148,18 +151,26 @@ files within it's directory.
148
151
<td>Utils for connecting to K8s</td>
149
152
<td>
150
153
<ol>
151
-
<li><b>build_gke_image</b>: Build docker image for running kubectl commands against GKE.</li>
152
-
<li><b>delete_gke_image</b>: Delete image from GKE.</li>
153
-
<li><b>run_docker_gke_command</b>: Run command in gke-utils container, already authenticated to k8s cluster.</li>
154
+
<li><b>bl_build_gke_image</b>: Build docker image for running kubectl commands against GKE.</li>
155
+
<li><b>bl_delete_gke_image</b>: Delete image from GKE.</li>
156
+
<li><b>bl_run_docker_gke_command</b>: Run command in gke-utils container, already authenticated to k8s cluster.</li>
154
157
</ol>
155
158
</td>
156
159
</tr>
157
160
<tr>
158
161
<td><a href="logging/lib">logging</a></td>
159
-
<td>Helpers related to login</td>
162
+
<td>Helpers related to logging.</td>
160
163
<td>
161
164
<ol>
162
-
<li><b>announce</b>: Echo message in ascii banner to distinguish it from other log messages.</li>
165
+
<li><b>bl_announce</b>: Echo message in ascii banner to distinguish it from other log messages.</li>
166
+
<li><b>bl_log</b>: Log a message at the specified level. Default log level is info, change level by setting environment variable BASH_LIB_LOG_LEVEL</li>
167
+
<li><b>bl_check_log_level</b>: Check if a value is a valid bash lib
168
+
log level</li>
169
+
<li><b>bl_debug</b>: Log a message at debug level</li>
170
+
<li><b>bl_info</b>: Log a message at info level</li>
171
+
<li><b>bl_warning</b>: Log a message at warning level</li>
172
+
<li><b>bl_error</b>: Log a message at error level</li>
173
+
<li><b>bl_fatal</b>: Log a message at fatal level</li>
163
174
</ol>
164
175
</td>
165
176
</tr>
@@ -168,9 +179,9 @@ files within it's directory.
168
179
<td>Helpers for executing tests</td>
169
180
<td>
170
181
<ol>
171
-
<li><b>shellcheck_script</b>: Execute shellcheck against a script, uses docker.</li>
172
-
<li><b>find_scripts</b>: Find git tracked files with extension.</li>
173
-
<li><b>tap2junit</b>: Convert a subset of <a href="http://testanything.org/">TAP</a> to JUnit XML. Retains logs for errors.</li>
182
+
<li><b>bl_shellcheck_script</b>: Execute shellcheck against a script, uses docker.</li>
183
+
<li><b>bl_find_scripts</b>: Find git tracked files with extension.</li>
184
+
<li><b>bl_tap2junit</b>: Convert a subset of <a href="http://testanything.org/">TAP</a> to JUnit XML. Retains logs for errors.</li>
0 commit comments