INNER CODE UNIT · TypeScript

setDefault

EndBug/add-and-commit · src/io.ts:123

  function setDefault(input: input, value: string) {
    if (!getInput(input)) setInput(input, value);
    return getInput(input);
  }

  // #region add, remove
  if (!getInput('add') && !getInput('remove'))
    throw new Error(
      "Both 'add' and 'remove' are empty, the action has nothing to do.",
    );

  if (getInput('add')) {
    const parsed = parseInputArray(getInput('add'));
    if (parsed.length === 1)
      safeInfo('Add input parsed as single string, running 1 git add command.');
    else if (parsed.length > 1)
      safeInfo(
        `Add input parsed as string array, running ${parsed.length} git add commands.`,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…