2014-04-14 20:45:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
OFILE=${1:-ctest/fixtures.js}
|
|
|
|
|
|
|
|
echo "README={}" > $OFILE
|
|
|
|
make_file(){
|
|
|
|
echo "README['"$1"'] = " >> $OFILE
|
|
|
|
echo "$2" >> $OFILE
|
|
|
|
echo ";" >> $OFILE
|
|
|
|
}
|
|
|
|
|
2016-10-15 06:09:05 +00:00
|
|
|
echo "main file: $OFILE"
|
2014-04-14 20:45:36 +00:00
|
|
|
make_file "str" "$(node -pe "JSON.stringify(require('fs').readFileSync('misc/codepage.md.utf8','utf8'))")"
|
|
|
|
for enc in ascii utf{7,8,{16,32}{le,be}}; do
|
|
|
|
echo "$enc" >&2
|
|
|
|
make_file "$enc" "$(node -pe "JSON.stringify(require('fs').readFileSync('misc/codepage.md.$enc'))")"
|
|
|
|
done
|
2016-10-15 06:09:05 +00:00
|
|
|
|
|
|
|
OFILE=${2:-ctest/iefix.js}
|
|
|
|
echo "README={}" > $OFILE
|
|
|
|
|
|
|
|
echo "mini file: $OFILE"
|
|
|
|
make_file "str" "$(node -pe "JSON.stringify(require('fs').readFileSync('misc/codepage_mini.md.utf8','utf8'))")"
|
|
|
|
for enc in ascii utf{7,8,{16,32}{le,be}}; do
|
|
|
|
echo "$enc" >&2
|
|
|
|
make_file "$enc" "$(node -pe "JSON.stringify(require('fs').readFileSync('misc/codepage_mini.md.$enc'))")"
|
|
|
|
done
|