Last active
December 10, 2015 02:28
-
-
Save jescalan/4367487 to your computer and use it in GitHub Desktop.
compiler spec (pseudocode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # error handling | |
| # -------------- | |
| compiler.on 'error', -> | |
| utils.add_error_messages() | |
| this.finish() | |
| compiler.one 'finished', -> | |
| console.log 'compilation done' | |
| # compile process | |
| # --------------- | |
| utils.analyze_project().then(create_folders).then (structure) -> | |
| async.parallel [compile_files, copy_static_files], compiler.finish | |
| compile_files(cb) -> | |
| async.map structure.compiled_files, compiler.compile, cb | |
| copy_static_files(cb) -> | |
| for file in structure.static_files | |
| utils.copy_sync src: file, dest: opts.folder | |
| cb() | |
| create_folders(structure) -> | |
| mkdir.sync(folder) for folder in structure.folders | |
| return structure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment