Skip to content

Commit

Permalink
fix: correctly check if gource_file_filter is set (#15)
Browse files Browse the repository at this point in the history
I was trying to use gource_file_filter and I noticed that it's not working. No matter what I put in there, I've always the the following output in the log file:

```
Using optional params:
```

Optional params where always empty. 

AFAIK the check if the filter is set is wrong. 

```bash
if [[ -z "$VAR" ]]; then
# ...
```

Checks for emptiness, whereas


```bash
if [[ ! -z "$VAR" ]]; then
# ...
```

checks that something is in the variable.

I can also confirm that not setting `gource_file_filter` will indeed output:

```
Using optional params: --file-filter ""
```

So, I guess in the code the check is accidentally switched from what it tried to achieve. :)
  • Loading branch information
ManuelRauber authored Nov 8, 2022
1 parent 5d0b2e1 commit d2fdf85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fi
if [[ $INPUT_GOURCE_START_DATE == *[!\ ]* ]]; then # Temporyry fix, check if it's a date
OPTIONAL_PARAMS+="--start-date ${INPUT_GOURCE_START_DATE} "
fi
if [[ -z "$INPUT_GOURCE_FILE_FILTER" ]]; then
if [[ ! -z "$INPUT_GOURCE_FILE_FILTER" ]]; then
OPTIONAL_PARAMS+="--file-filter \"$INPUT_GOURCE_FILE_FILTER\" "
fi

Expand Down

0 comments on commit d2fdf85

Please sign in to comment.