Git Product home page Git Product logo

cake.prompt's Introduction

Cake.Prompt

Cake AddIn that extends Cake with interactive user prompts.

.NET NuGet

Definition

/// <summary>
/// Prompts the user for input.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="message">The message which is shown to the user.</param>
/// <param name="defaultResult">Value supplied if the user simply returns with no input</param>
/// <param name="timeout">Timeout time, defaults to 30 seconds</param>
/// <returns>The user input.</returns>
string Prompt(this ICakeContext context, string message, string defaultResult = default, TimeSpan timeout = default);

Usage

NuGetPush(packagePath, new NuGetPushSettings {
    ApiKey = Prompt("Enter api key for NuGetPush:")
});
var shouldContinue = Prompt("Do you want to continue? [Y/N]", "N").Trim().ToUpperInvariant() == "Y";
if (shouldContinue)
{
    ...
}

The Prompt() method throws a TimeoutException after the supplied timeout duration (Defaults to 30 seconds).

cake.prompt's People

Contributors

megakid avatar yvschmid avatar jericho avatar awaescher avatar twenzel avatar

Stargazers

Tanner Watson avatar

Watchers

James Cloos avatar Dave Glick avatar Gary Ewan Park avatar Alistair Chapman avatar  avatar Pascal Berger avatar Martin Björkström avatar  avatar

cake.prompt's Issues

Add cake-contrib user

First of all, I wanted to thank you for adding to the Cake community by adding this addin.

I was just wondering if you had seen this blog post:

http://cakebuild.net/blog/2016/08/cake-contribution-organization

We are currently going through a process of increasing the visibility of addins, and also trying to ensure their long term maintainability.

To that end, we are asking addin creators to add the cake-contrib user on NuGet as a co-owner (this can be done through the NuGet website by clicking on Manage Owners on the package page).

Would you be interested in doing this? If you have any questions about this, please let me know. There was some initial concern that the Cake Team were trying to "take over" packages, and that couldn't be further from the truth, and if you have this concern, or others, I would like to address them.

Thanks!

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.31.0. Please upgrade to 0.33.0
  • The Cake.Core reference should be private. Specifically, your addin's .csproj should have a line similar to this: <PackageReference Include="Cake.Core" Version="0.33.0" PrivateAssets="All" />
  • The nuget package for your addin should use the cake-contrib icon. Specifically, your addin's .csproj should have a line like this: <PackageIconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png</PackageIconUrl>.

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.

This issue was created by a tool: Cake.AddinDiscoverer version 3.12.1

ReadMe.md shows usage of the reserved keyword `continue` as variable

Thanks for pushing this to NuGet.

I just had a hard time wondering why my scripts won't run anymore:

image

The reason is clear, but it took me a while to find it: The variable continue - as shown in the code sample in the readme.md - is a reserved keyword.

var continue = Prompt("Do you want to continue? [Y/N]", "N").Trim().ToUpperInvariant() == "Y";
if (continue)
    ...

Would you please rename that variable to a non-reserved one?

var shouldContinue = Prompt("Do you want to continue? [Y/N]", "N").Trim().ToUpperInvariant() == "Y";
if (shouldContinue)
    ...

Version warning

HI,

getting this warning:
image

add-in loaded with

#addin nuget:?package=Cake.FileHelpers&version=4.0.1&loaddependencies=true
#addin nuget:?package=Cake.Email&version=1.0.2&loaddependencies=true
#addin nuget:?package=Cake.Prompt&version=1.0.15&loaddependencies=true

Update to latest Cake SDK

TheCake.Prompt addin is referencing an older version of Cake.Core (0.33.0).
For best compatibility it should target Cake.Core version 1.0.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.