Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
Merge pull request #2 from eisberg-labs/add-fixes
Browse files Browse the repository at this point in the history
Add fixes
  • Loading branch information
amarjanica authored Jan 3, 2023
2 parents 9c4ecc1 + cbf19c2 commit 5c2fcee
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Unreleased

### BREAKING CHANGE

- Recursive folder search

### Fix

- add recursive folder search, fix for undefined EXCLUDES_REGEX that excludes everything

## v2 (2022-12-21)

## v1 (2022-12-21)
24 changes: 14 additions & 10 deletions deploy-doc-to-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ function remove_html_extension() {
TARGET=$1
EXCLUDES_REGEX=$2

for filename in $TARGET/*.html; do
for filename in $(find $TARGET -type f -name '*.html'); do
# File is html and not in $EXCLUDES_REGEX files
if [[ $filename =~ ^.+\.html$ && ! $filename =~ $EXCLUDES_REGEX ]]; then
original="$filename"
# Get the filename without the path/extension
filename=$(basename "$filename")
extension="${filename##*.}"
filename="${filename%.*}"

# Move it
mv $original $TARGET/$filename
if [[ $filename =~ ^.+\.html$ ]]; then
if [[ ! -z $EXCLUDES_REGEX && $filename =~ $EXCLUDES_REGEX ]]; then
echo 'skipping $filename'
else
original="$filename"
# Get the filename without the path/extension
filename=$(basename "$filename")
extension="${filename##*.}"
filename="${filename%.*}"

# Move it
mv $original $TARGET/$filename
fi
fi
done
}
Expand Down

0 comments on commit 5c2fcee

Please sign in to comment.