Skip to content

Instantly share code, notes, and snippets.

@jescalan
Last active December 10, 2015 02:28
Show Gist options
  • Select an option

  • Save jescalan/4367487 to your computer and use it in GitHub Desktop.

Select an option

Save jescalan/4367487 to your computer and use it in GitHub Desktop.
compiler spec (pseudocode)
# 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