-
-
Save asvid/0eff5148b4c72710f49525e944c799c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ARG_PATH="/" | |
| CONFIG_PATH="/" | |
| if [ ! -z "$ARG_PATH" ]; then # if path was provided as argument | |
| if [ -d "$ARG_PATH" ]; then # check if it exists | |
| echo File exists! | |
| if [ -r $ARG_PATH ] && [ -s $ARG_PATH ]; then | |
| echo This file readable and not empty. | |
| fi | |
| else | |
| echo Provided path not found: $ARG_PATH | |
| exit 1 | |
| fi | |
| elif [ -d "$CONFIG_PATH" ]; then | |
| echo At least there is some config file | |
| else | |
| echo Path not provided | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment