module MiGA::Project::Hooks

def default_hooks

def default_hooks
  {
    on_result_ready: [[:_pull_result_hooks]]
  }
end

def hook__pull_result_hooks(_hook_args, event_args)

Pull the hook specific to the type of result
Dataset Action :pull_result_hooks([], [res])
#
def hook__pull_result_hooks(_hook_args, event_args)
  pull_hook(:"on_result_ready_#{event_args.first}", *event_args)
  pull_hook(:on_processing_ready) if next_task(nil, false).nil?
end

def hook_run_cmd(hook_args, event_args)

- +event_args+: +[object (optional)]+
- +hook_args+: +[cmd]+
project, project_name, miga, object (if defined by the event)
Run +cmd+ in the command-line with {{variables}}:
#
def hook_run_cmd(hook_args, event_args)
  Process.wait(
    spawn hook_args.first.miga_variables(
      project: path, project_name: name,
      miga: MiGA::MiGA.root_path, object: event_args.first
    )
  )
end