unixdigest / phpthewrongway

A pragmatic view on PHP programming.
https://www.phpthewrongway.com
Other
382 stars 69 forks source link

Add check if all file exists in locale folder #63

Closed umutphp closed 5 years ago

umutphp commented 5 years ago

When a file does not exist in a locale, the make process is stopped.

Closes #62

unixdigest commented 5 years ago

Thank you very much for the work you have put into this!

I have tested the "test" of a missing file by just removing a file in the Danish section and the error output looks like this:

\n### Checking : da
for mdfile in welcome the_danger_of_extremism always_use_a_framework always_use_a_design_pattern always_use_oop being_afraid_of_other_peoples_code follow_the_php_fig_standards neglecting_security faq recommended_reading contribute ; do if [ ! -f sections/da/$mdfile.md ]; then echo "$mdfile.md does not exist!"; exit 1; fi done
always_use_a_framework.md does not exist!
make: *** [Makefile:44: da] Error 1

I myself is not a Makefile expert :) but it looks like it is also outputting the Makefile content itself rather than just the error message.

umutphp commented 5 years ago

Yes, you are right but It is same for building commands.

Below is a sample output from a successful build;

### Checking : da
for mdfile in welcome the_danger_of_extremism always_use_a_framework always_use_a_design_pattern always_use_oop being_afraid_of_other_peoples_code follow_the_php_fig_standards neglecting_security faq recommended_reading contribute ; do if [ ! -f sections/da/$mdfile.md ]; then echo "$mdfile.md does not exist!"; exit 1; fi done
for txtfile in text_for_the_cartoon ; do if [ ! -f sections/da/$txtfile.txt ]; then echo "$txtfile.txt does not exist!"; exit 1; fi done

### Building : da
mkdir -p docs/da
pandoc -s --highlight-style zenburn -f markdown+smart -t markdown-smart -w html5 --template inc/default_da.html5 --toc -c /css/html.css -o docs/da/index.html inc/logo_and_date_da.txt sections/da/welcome.md sections/da/the_danger_of_extremism.md sections/da/always_use_a_framework.md sections/da/always_use_a_design_pattern.md sections/da/always_use_oop.md sections/da/being_afraid_of_other_peoples_code.md sections/da/follow_the_php_fig_standards.md sections/da/neglecting_security.md sections/da/faq.md sections/da/recommended_reading.md sections/da/contribute.md
grep -rl "##DATEFIELD##" docs/da/index.html | xargs sed -i "s/##DATEFIELD##/Sidst opdateret: `date '+%d\/%m-%Y'`/"
unixdigest commented 5 years ago

Sorry for the delay in my response!

Yes, I will have to look into this when I get the time. I haven't added those parts myself.