{"size": 307, "ext": "js", "max_stars_repo_path": "src/restart/index.js", "max_stars_repo_name": "beauallison/homebrew-services", "max_stars_repo_stars_event_min_datetime": "2018-03-16T16:40:12.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-21T03:12:22.000Z", "max_issues_repo_path": "src/restart/index.js", "max_issues_repo_name": "beauallison/homebrew-services", "max_issues_repo_issues_event_min_datetime": "2018-03-16T19:54:18.000Z", "max_issues_repo_issues_event_max_datetime": "2018-04-28T13:35:32.000Z", "max_forks_repo_path": "src/restart/index.js", "max_forks_repo_name": "beauallison/homebrew-services", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 25.5833333333, "max_line_length": 68, "alphanum_fraction": 0.5928338762}
const run = require('../run');

module.exports = async ({ service } = {}) => {
  if (!service) throw new Error('Missing input parameter: service');
  try {
    await run(['restart', service]);
    return { status: 'restarted' };
  } catch (err) {
    throw new Error(`Failed to restart ${service}`);
  }
};
