The quick way:
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
git remote prune origin
Use the following to have the branches displayed before you’re asked to delete them.
branches=$(git branch --merged master | grep -v '^[ *]*master$'); \
printf '\n\nBranches to be removed:\n---\n'; \
echo ${branches} | xargs -n1; \
printf '---\n\nRemove the branches above? [Ny] ' \
&& read shouldDelete \
&& [[ "${shouldDelete}" =~ [yY] ]] \
&& echo $branches | xargs git branch -d \
|| echo 'aborted'
Is Ansible giving you the error unsupported parameter for module: path
when you’re using lineinfile
?
Check your Ansible-version!
You probably used path (as of version 2.3) instead of dest.
$ ansible --version
ansible 2.2.1.0
config file =
configured module search path = Default w/o overrides
As the Ansible documentation states:
As of Ansible 2.3, the
dest
option has been changed topath
as default, butdest
still works as well.
Solution: change dest
into path
This fixed it for me. Now I can ensure composer is in my path.
# file composer.yml
# add composer to $PATH
- lineinfile:
regexp: 'export PATH=".*/project/vendor/bin.*"'
line: 'export PATH="$PATH:/project/vendor/bin"'
state: present
dest: /home/vagrant/.bashrc
Explanation of the parts:
present
or absent
line
should be there. Tip: for advanced usage, look at backrefs
for changing parts of the line.