{"size": 868, "ext": "js", "max_stars_repo_path": "src/visualise.js", "max_stars_repo_name": "djsharman/statejs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/visualise.js", "max_issues_repo_name": "djsharman/statejs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/visualise.js", "max_forks_repo_name": "djsharman/statejs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.125, "max_line_length": 69, "alphanum_fraction": 0.7269585253}
import getDefFilesArray from "./definition/getDefFilesArray";
import cleanArgStrings from "./utils/cleanArgStrings";
import SMVisualiser from "./visualiser/SMVisualiser";

const args = process.argv.slice(2);

const baseDirRaw = args[0];
const baseDir = cleanArgStrings(baseDirRaw);
const defsDir = baseDir + "/_defs";
const diagramLoc = defsDir + "/diagrams";
let genDenatured = false;

// check if we should generate a denatured diagram
if (typeof args[1] !== "undefined") {
  genDenatured = true;
}

try {
  // get a list of the SMs defined in the _defs directory
  const defFiles = getDefFilesArray(defsDir);
  console.log(defFiles);

  defFiles.forEach((defFileName) => {
    let generator = new SMVisualiser();
    generator.create(defFileName, defsDir, diagramLoc, genDenatured);
  });

  console.log("Visualisation complete");
} catch (e) {
  console.log(e);
}
