waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
https://fuqua.io/CSharpRepl/
Mozilla Public License 2.0
2.92k stars 113 forks source link

Csharprepl cannot find script in current working directory #310

Closed amine-aboufirass closed 11 months ago

amine-aboufirass commented 1 year ago

Version

0.6.5

What happened?

If I create a simple hello world CSX script file in my current working directory and then try to run it using csharprepl test.csx in my Powershell terminal I get the following output:

Welcome to the C# REPL (Read Eval Print Loop)!
Type C# expressions and statements at the prompt and press Enter to evaluate them.
Type help to learn more, exit to quit, and clear to clear your terminal.

Running supplied CSX file...
┌────────────────────────────────────────Exception────────────────────────────────────────┐
│ (1,7): error CS1504: Source file 'test.csx' could not be opened -- Could not find file. │
└─────────────────────────────────────────────────────────────────────────────────────────┘

The weird thing is that when I do Directory.GetCurrentDirectory() I indeed get back my current working directory.

To actually get it to work I need to run

csharprepl (ls test.csx | select -expandproperty fullname)

To retrieve the full file name, which is not ideal.