3 # Copy Email Self-Defense translations locally from enc to enc-live.
4 # and update the language pickers.
5 # The two repos are assumed to have the same parent directory.
6 # The script is called from the root of enc-live:
7 # copy-enc-to-live LANG
9 # ***** Check that lang-picker-source is up to date. *****
14 pages
='confirmation.html index.html infographic.html next_steps.html workshops.html'
16 test -n "$lang" ||
(echo " !!! Please enter a language code as argument.";
19 # The files we need are on the master branch of enc.
22 # Get the ID of the last commit on this branch for future reference, and
23 # truncate it to 7 digits.
24 commit
=$
(git rev-parse HEAD | cut
-b -7)
26 # Go back to enc-live.
28 # Create the LANG directory if it doesn't exist.
31 # Take one page at a time.
34 # If it exists in enc,
35 if [ -f ..
/enc
/$lang/$p ]; then
36 # copy it to enc-live.
37 cp ..
/enc
/$lang/$p $lang/
41 echo " !!! $lang/$p doesn't exist"
42 # restore enc-live to its original state,
49 # Add and commit the changes.
51 # Refer to the enc commit ID in the enc-live commit message.
52 git commit
-m "$lang: synchronize with enc $commit."