Skip to content

Commit 35e9177

Browse files
authored
Merge pull request #54 from corporate-gadfly/useless-use-of-cat
avoid cat when used with single file
2 parents 1986ddf + c6e2185 commit 35e9177

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@
3333
bolt.log
3434
Puppetfile.lock
3535
modules
36+
site-modules

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## Development
66

7+
* Fixed trivial bug with useless use of cat
8+
9+
Contributed by Haroon Rafique
10+
711
## Release 1.1.0 (2020-04-15)
812

913
* Added new plans `patching::get_facts` to retrieve a set of facts from a list of targets

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Quick start
44

55
```shell
6-
ln -s ../ site-modules/patching
6+
mkdir site-modules && ln -s ../ site-modules/patching
77
vagrant up centos
88
bolt task run facts --targets vagrant_centos
99
```

files/bash/os_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

33
if [ -e /etc/os-release ]; then
4-
export OS_RELEASE=$(cat /etc/os-release | sed -n -e "/^ID=/p" | sed -e 's~\(.*\)=\(.*\)~\U\2~g' -e 's~"~~g')
4+
export OS_RELEASE=$(sed -n -e "/^ID=/p" /etc/os-release | sed -e 's~\(.*\)=\(.*\)~\U\2~g' -e 's~"~~g')
55
else
66
# fall back to older methods for OS that do not use systemd
77
export OS_TEST_DEB=$(lsb_release -a 2> /dev/null | grep Distributor | awk '{print $3}')
8-
export OS_TEST_RH=$(cat /etc/redhat-release 2> /dev/null | sed -e "s~\(.*\)release.*~\1~g")
8+
export OS_TEST_RH=$(sed -e "s~\(.*\)release.*~\1~g" /etc/redhat-release 2> /dev/null)
99

1010
if [[ -n "$OS_TEST_RH" ]]; then
1111
export OS_RELEASE='RHEL'

0 commit comments

Comments
 (0)