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;
|
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();
|
Process process = new Process();
|
||||||
processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
|
||||||
processStartInfo.FileName = @"ls";
|
|
||||||
processStartInfo.WorkingDirectory = @"/home/andre";
|
|
||||||
processStartInfo.Arguments = "--color";
|
|
||||||
processStartInfo.RedirectStandardOutput = false;
|
|
||||||
processStartInfo.RedirectStandardError = false;
|
|
||||||
processStartInfo.UseShellExecute = true;
|
|
||||||
|
|
||||||
process.StartInfo = processStartInfo;
|
ProcessStartInfo processStartInfo = new ProcessStartInfo();
|
||||||
process.Start();
|
//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>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
|
<SelfContained>true</SelfContained>
|
||||||
|
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||||
|
<PublishReadyToRun>true</PublishReadyToRun>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user