Skip to content

Instantly share code, notes, and snippets.

@veltman
Created August 23, 2014 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veltman/8822eb9a25488c228a52 to your computer and use it in GitHub Desktop.
Save veltman/8822eb9a25488c228a52 to your computer and use it in GitHub Desktop.
cd TimelineJS/source/js/Core/Language/locale
# Append fs.writeFile("[abbreviation].json",JSON.stringify(VMM.Language)) to each file
for f in *; do echo "fs.writeFile(\"$f\".replace(\".js\",\".json\"),JSON.stringify(VMM.Language));" >> $f; done
# Initialize required vars in an alphabetically first file
echo "var fs = require('fs'), trace = function(){}, VMM = {};" > aa.js
# Combine to one script
cat * > execute-me.js
# Run it
node execute-me.js
# Folder now contains a *.json for each one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment