export function readPositionalFile()

in util/config/configurator/configurator.ts [291:316]


export function readPositionalFile(positionals: string[]): {
  success: boolean;
  message?: string;
  help?: string;
  jsonFilePath?: string;
} {

  if (positionals.length < 2) {
    console.error("This should not happen");
    return { success: false, message: "This should not happen" };
  }

  if (positionals.length === 2) {
    return { success: true, help: HelpMsg };
  }

  if (positionals.length > 3) {
    return {
      success: true,
      message: AdditionalArgsMsg,
      jsonFilePath: positionals[2],
    };
  }

  return { success: true, jsonFilePath: positionals[2] };
}