Skip to content

Conversation

joshcangit
Copy link

Requirements for Adding, Changing, or Removing a Feature

Issue or RFC Endorsed by Atom's Maintainers

Description of the Change

The change use different commands for Linux.
Mainly, depending on .NET Core.

For C#, dotnet is used instead of mono.

Might want to change csc to dotnet csc when that becomes available.

For C# scripts, dotnet script is used instead of scriptcs.

Might want to change to dotnet csi when that beomes available.

For F# scripts, dotnet fsi is used instead of fsharpi

Alternate Designs

I haven't made checks which may need the lookpath Node.js package.
That is to check maybe if mono or dotnet is installed.

Possible Drawbacks

The dotnet script seems to be only in user directory.
That may mean .csx won't work outside the user environment.

Verification Process

I use certain files to test this.

  • C# example
using System;

namespace HelloWorld
{
  class Program
  {
    static void Main(string[] args)
    {
      Console.WriteLine("Hello World!");
    }
  }
}
  • C# script
//usr/bin/env dotnet script "$0" "$@";exit $?

var fw = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;
var arch = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture;
Console.WriteLine($"Hello world ({fw}, {arch})");
  • F# script
//usr/bin/env dotnet fsi "$0" "$@";exit $?

printfn "Hello world!"

Release Notes

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant