Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wiki documentation for Shell #26

Open
7 tasks
yevhen opened this issue Apr 15, 2020 · 5 comments
Open
7 tasks

Fix wiki documentation for Shell #26

yevhen opened this issue Apr 15, 2020 · 5 comments

Comments

@yevhen
Copy link
Owner

yevhen commented Apr 15, 2020

  • Complete documentation for Shell.Cmd
  • Complete documentation for Shell.Run
  • Samples for piping and redirects
  • Samples for using Tee class
  • Document await-ing strings
  • Document argument escaping in commands
  • Document backslash for line continuations
@bufferUnderrun
Copy link

bufferUnderrun commented Sep 29, 2022

i follow the wiki and await-ing is not working :

var result = await $"dir";
WriteLine(result.ExitCode);
result.StdOut.ForEach(WriteLine);

Resulting

Script compilation failure! See diagnostics below.

Nake.csx(26,1): error CS0670: Field cannot have void type
Nake.csx(27,17): error CS0023: Operator '.' cannot be applied to operand of type 'void'
Nake.csx(28,7): error CS0023: Operator '.' cannot be applied to operand of type 'void'

So where i miss the point ?

Thanks for your help.

@bufferUnderrun
Copy link

bufferUnderrun commented Sep 29, 2022

Same for the official doc in the readme.md : copy/paste and running code throw error.
For the last v3.0, the starting template looks like :

#r "nuget: Nake.Meta" // for Nake attribute
#r "nuget: Nake.Utility" // for all other class

using Nake;
using static Nake.Shell;
using static System.Console;

[Nake] void Default() {
    Console.WriteLine("Default();");
    Nake.Session.Exit("ok");
}

@yevhen
Copy link
Owner Author

yevhen commented Nov 8, 2022

Uh, somehow lost this issue.

@bufferUnderrun I'll check that. But I swear awaiting works fine. I use it extensively here https://github.com/yevhen/Streamstone/blob/master/Nake.csx

@stratdev3
Copy link

stratdev3 commented Feb 23, 2023

I found the issue : await works but does not return any value whereas the wiki documentation says it can.

Working

#r "nuget: Nake.Meta" // for Nake attribute
#r "nuget: Nake.Utility" // for all other class

using Nake;
using static Nake.Shell;
using static System.Console;

[Nake] async Task Default() {
    await $"dir";
    Nake.Session.Exit("ok");
}

Not working

#r "nuget: Nake.Meta" // for Nake attribute
#r "nuget: Nake.Utility" // for all other class

using Nake;
using static Nake.Shell;
using static System.Console;

[Nake] async Task Default() {
    var result = await $"dir";
    Nake.Session.Exit("ok");
}

Error

Script compilation failure! See diagnostics below.
C:\www\appweb\src\nake.csx(78,9): error CS0815: Cannot assign void to an implicitly-typed variable

One last question : What is the difference between Cmd("dir"); and await $"dir"; ?

Thanks for you help

@yevhen
Copy link
Owner Author

yevhen commented Mar 15, 2023

@stratdev3 I'll check this and get back to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants