Skip to content

Commit

Permalink
🐛 Fix exclude option
Browse files Browse the repository at this point in the history
  • Loading branch information
Kévin Painchaud committed Jul 4, 2020
1 parent 11b27e0 commit ff2cc69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Delete files not present in the local folder on the remote folder. Default `"fal

### `exclude`

Ignore file(s) and/or directorie(s). Default `()`.
Ignore file(s) and/or directorie(s). Default `""`.

Fill an array of regex. E.g. `("^logs/", "^README.md")`
Fill an array of regex. E.g. `"'^logs/' '^README.md'"`

### `disable_ssl_certificate_verification`

Expand All @@ -49,5 +49,5 @@ with:
local_source_dir: "dist"
dist_target_dir: "www/my-app"
delete: "true"
exclude: ("^logs/", "^README.md")
exclude: "'^logs/' '^README.md'"
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inputs:
exclude:
description: "Ignore file(s) and/or directorie(s)"
required: false
default: ()
default: ""
disable_ssl_certificate_verification:
description: "Disable SSL certificate verification"
required: false
Expand Down
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/sh -l

lftp $INPUT_FTP_HOST -u $INPUT_FTP_USERNAME,$INPUT_FTP_PASSWORD -e "$([ "$INPUT_DISABLE_SSL_CERTIFICATE_VERIFICATION" == true ] && echo "set ssl:verify-certificate false;") mirror --verbose --reverse $([ "$INPUT_DELETE" == true ] && echo "--delete") $INPUT_LOCAL_SOURCE_DIR $INPUT_DIST_TARGET_DIR; exit"
# Construct the exclude commands
for excludedPath in $INPUT_EXCLUDE
do
EXCLUDE="$EXCLUDE --exclude $excludedPath"
done

lftp $INPUT_FTP_HOST -u $INPUT_FTP_USERNAME,$INPUT_FTP_PASSWORD -e "$([ "$INPUT_DISABLE_SSL_CERTIFICATE_VERIFICATION" == true ] && echo "set ssl:verify-certificate false;") mirror --verbose --reverse $([ "$INPUT_DELETE" == true ] && echo "--delete") $EXCLUDE $INPUT_LOCAL_SOURCE_DIR $INPUT_DIST_TARGET_DIR; exit"

0 comments on commit ff2cc69

Please sign in to comment.