Skip to content

Commit

Permalink
wswsh: Remove external file support.
Browse files Browse the repository at this point in the history
We gain 11 SLOC by removing an optional feature which shouldn't
be included in the main script. The needed file(s) could be easily
added via Makefile (or even an external script called with make).
There was also a nasty "bug" when a file added via FIL, had the same
extension specified in EXT. It was badly handled by INTERP.

A specific find command could be written but once again this feature
isn't the "core" of wswsh (vs LOC ratio).
HTML files are still automatically managed, therefore you don't need
to specify them somewhere (bump Alex).
  • Loading branch information
Ypnose committed Feb 25, 2015
1 parent d9bae1c commit 2ba1281
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
13 changes: 0 additions & 13 deletions wswsh
Expand Up @@ -109,19 +109,6 @@ function gen_page {
cp -- "$LINEH" "dest/${LINEH#*/}"
done

# Test if the file exists. Then find it/them and copy it/them to dest (supports multiple files with same name).
if [[ -n $FIL ]]; then
for y in $FIL; do
if [[ -z $(find "src" -type f -name "$y") ]]; then
print -- "$y is missing"
continue
fi
find "src" -type f -name "$y" | while IFS=$'\n' read -r LINEF; do
cp "src/${LINEF#*/}" "dest/${LINEF#*/}"
done
done
fi

cd ..
TOT=$(find "${RAC}/dest" -type f | wc -l)
print "Generated $TOT files"
Expand Down
5 changes: 0 additions & 5 deletions wswsh.conf.default
Expand Up @@ -48,8 +48,3 @@
# DON'T FORGET THE TRAILING SLASH!
# Default value (when FEED is enabled): dest/
#RSSDIR=""

# Files not handled by the generation.
# Useful for robots.txt files for example.
# Separate filename with spaces.
#FIL=""

1 comment on commit 2ba1281

@alexh-name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bump Alex". only noticed it just now :D

Please sign in to comment.