/Dotnet-Bash-Wrapper

A small set of C# methods that helps you execute bash-shell commands or .sh files

Primary LanguageC#

.Net Bash Wrapper

Summary

.Net Bash Wrapper is a small set of C# methods that helps you execute cmd/terminal commands or .sh files using C# code. The Wrapper can be used on any .NET application or Unity application/game.


Source Files

File Description
BashWrapper.cs Core Methods for Bash Wrapper
BashManager.cs Managing and Simplifying Bash Wrapper Functionality

Methods

Bash Manager

1. RunAsync

Description:
Executes asynchronous cmd or terminal commands.

2. RunSync

Description:
Executes synchronous cmd or terminal commands.

3. BashAsExecutableAsync

Description:
Makes a bash file executable asynchronously

4. BashAsExecutableSync

Description:
Makes a bash file executable synchronously

Bash Wrapper

1. Run
public static async Task<T> Run<T>(string command, bool debug = false)

Description:
Executes a single cmd or terminal command.
Parameters:

  • string command: The command to execute.
  • bool debug: Whether or not to print logs.
2. BashAsExecutable
public static async Task<T> BashAsExecutable<T>(string bashFileName)

Description:
Makes a bash (.sh) script executable.
Parameters:

  • string bashFileName: The name of file we want to make executable.