Trying to get the user home
This commit is contained in:
parent
763de0a371
commit
9c05f3ac83
29
Program.cs
29
Program.cs
@ -1,15 +1,22 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
Process process = new Process();
|
||||
string homePath;
|
||||
if(Environment.OSVersion.Platform == PlatformID.Unix) {
|
||||
homePath = Environment.GetEnvironmentVariable("HOME");
|
||||
} else {
|
||||
Console.WriteLine("This script doesn't support your operating system.");
|
||||
}
|
||||
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo();
|
||||
processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
processStartInfo.FileName = @"ls";
|
||||
processStartInfo.WorkingDirectory = @"/home/andre";
|
||||
processStartInfo.Arguments = "--color";
|
||||
processStartInfo.RedirectStandardOutput = false;
|
||||
processStartInfo.RedirectStandardError = false;
|
||||
processStartInfo.UseShellExecute = true;
|
||||
Process process = new Process();
|
||||
|
||||
process.StartInfo = processStartInfo;
|
||||
process.Start();
|
||||
ProcessStartInfo processStartInfo = new ProcessStartInfo();
|
||||
//processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
processStartInfo.FileName = @"yay";
|
||||
//processStartInfo.WorkingDirectory = homePath;
|
||||
//processStartInfo.Arguments = "--color";
|
||||
processStartInfo.RedirectStandardOutput = false;
|
||||
processStartInfo.RedirectStandardError = false;
|
||||
processStartInfo.UseShellExecute = true;
|
||||
|
||||
process.StartInfo = processStartInfo;
|
||||
process.Start();
|
@ -3,6 +3,10 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<SelfContained>true</SelfContained>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user