How to use the @lerna/prompt.confirm function in @lerna/prompt

To help you get started, we’ve selected a few @lerna/prompt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lerna / lerna / commands / version / index.js View on Github external
output("");
    output("Changes:");
    output(changes.join(os.EOL));
    output("");

    if (this.options.yes) {
      this.logger.info("auto-confirmed");
      return true;
    }

    // When composed from `lerna publish`, use this opportunity to confirm publishing
    const message = this.composed
      ? "Are you sure you want to publish these packages?"
      : "Are you sure you want to create these versions?";

    return PromptUtilities.confirm(message);
  }
github lerna / lerna / commands / import / index.js View on Github external
this.preImportHead = this.getCurrentSHA();

    if (this.execSync("git", ["diff-index", "HEAD"])) {
      throw new ValidationError("ECHANGES", "Local repository has un-committed changes");
    }

    this.logger.info(
      "",
      `About to import ${this.commits.length} commits from ${inputPath} into ${targetDir}`
    );

    if (this.options.yes) {
      return true;
    }

    return PromptUtilities.confirm("Are you sure you want to import these commits onto the current branch?");
  }
github lerna / lerna / commands / publish / index.js View on Github external
const count = this.packagesToPublish.length;
    const message = this.packagesToPublish.map(
      pkg => ` - ${pkg.name} => ${this.updatesVersions.get(pkg.name)}`
    );

    output("");
    output(`Found ${count} ${count === 1 ? "package" : "packages"} to publish:`);
    output(message.join(os.EOL));
    output("");

    if (this.options.yes) {
      this.logger.info("auto-confirmed");
      return true;
    }

    return PromptUtilities.confirm("Are you sure you want to publish these packages?");
  }
github lerna / lerna / commands / clean / index.js View on Github external
return chain.then(() => {
      if (this.options.yes) {
        return true;
      }

      this.logger.info("", "Removing the following directories:");
      this.logger.info(
        "clean",
        this.directoriesToDelete.map(dir => path.relative(this.project.rootPath, dir)).join("\n")
      );

      return PromptUtilities.confirm("Proceed?");
    });
  }

@lerna/prompt

An internal Lerna tool

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis