Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -prune for "REPLACE_ENV_VARIABLES_EXCLUDE_PATHS" feature. #588

Merged
merged 1 commit into from
Jul 18, 2020

Conversation

Trikolon
Copy link
Sponsor Contributor

Using the -prune option to exclude paths in "find" should be a lot more efficient than -not since it prevents find from traversing excluded directories / files.

Using the -prune option to exclude paths in "find" should be a lot more efficient than -not since it prevents find from traversing excluded directories / files.
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for finally solving the -prune.

@@ -1,5 +1,7 @@
#!/bin/bash

function join_by { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 thing=(abc def 123)
$ printf "%s|" ${thing[@]} | sed 's/.$//'
abc|def|123

What about this?

join(){ 
   local d="${1:?You need a delimiter}"
   printf "%s$d" "${@:1}" | sed 's/.$//'; 
}

the ? in the variable assignment is an assertion - probably a good idea

@itzg itzg merged commit 747c188 into itzg:master Jul 18, 2020
@itzg
Copy link
Owner

itzg commented Jul 18, 2020

This is now pushed to Docker Hub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants