mirror of
https://github.com/varunsridharan/actions-toolkit.git
synced 2024-09-20 06:56:06 +08:00
Added is_empty_var
This commit is contained in:
parent
41dad168e3
commit
cfa56adf5b
28
README.md
28
README.md
|
@ -38,27 +38,19 @@ GH_LOG::log('Hello World');
|
|||
# Configure GIT Username & EMail
|
||||
# Defaults To "Github Action Bot" "githubactionbot@gmail.com"
|
||||
gitconfig "Git Commit Username" "Git Commit Email"
|
||||
|
||||
# Install Bash Script In AlpineOS
|
||||
installbash
|
||||
|
||||
# Install Curl In AlpineOS
|
||||
installcurl
|
||||
|
||||
# Install Git In AlpineOS
|
||||
# Installed By Default if setup-alpine.sh script used
|
||||
installgit
|
||||
|
||||
# Install wget In AlpineOS
|
||||
# Installed By Default if setup-alpine.sh script used
|
||||
installwget
|
||||
|
||||
# Install unzip In AlpineOS
|
||||
# Installed By Default if setup-alpine.sh script used
|
||||
installunzip
|
||||
```
|
||||
### Shell Functions
|
||||
|
||||
#### `is_empty_var`
|
||||
```shell script
|
||||
# Below Will Output DEFAULT_NAME if $NAME is not set / empty
|
||||
echo "$(is_empty_var "${NAME}" "DEFAULT_NAME")"
|
||||
|
||||
# Below Will Output 43 as $AGE is set
|
||||
AGE="43"
|
||||
echo "$(is_empty_var "${AGE}" "33")"
|
||||
```
|
||||
|
||||
#### `gh_set_output`
|
||||
```shell script
|
||||
# {KEY} Custom Output Key
|
||||
|
|
|
@ -11,3 +11,11 @@ gh_set_output() {
|
|||
gh_mask_output() {
|
||||
echo "::add-mask::${1}"
|
||||
}
|
||||
|
||||
is_empty_var(){
|
||||
if [ -z "$1" ]; then
|
||||
echo "$2"
|
||||
else
|
||||
echo "$1"
|
||||
fi
|
||||
}
|
Loading…
Reference in a new issue