mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Add --user-variables-file
parameter when starting a service
This commit is contained in:
parent
c157116680
commit
86916d2ed9
|
@ -34,6 +34,7 @@ using System.Collections.Generic;
|
|||
using WelsonJS.TinyINIController;
|
||||
using System.Collections;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
|
||||
namespace WelsonJS.Service
|
||||
{
|
||||
|
@ -256,15 +257,27 @@ namespace WelsonJS.Service
|
|||
|
||||
// make the start arguments
|
||||
string[] startArguments;
|
||||
string[] _args;
|
||||
if (Environment.UserInteractive)
|
||||
{
|
||||
startArguments = new string[args.Length + 1];
|
||||
args.CopyTo(startArguments, 0);
|
||||
startArguments[args.Length] = "--user-interactive";
|
||||
_args = new string[]
|
||||
{
|
||||
$"--user-variables-file={userVariablesHandler.GetEnvFilePath()}",
|
||||
"--user-interactive"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
startArguments = args;
|
||||
_args = new string[]
|
||||
{
|
||||
$"--user-variables-file={userVariablesHandler.GetEnvFilePath()}"
|
||||
};
|
||||
}
|
||||
startArguments = new string[args.Length + _args.Length];
|
||||
args.CopyTo(startArguments, 0);
|
||||
for (int i = 0; i < _args.Length; i++)
|
||||
{
|
||||
startArguments[args.Length + i] = _args[i];
|
||||
}
|
||||
|
||||
// initialize
|
||||
|
|
|
@ -72,5 +72,10 @@ namespace WelsonJS.Service
|
|||
userVariables.TryGetValue(name, out string value);
|
||||
return value;
|
||||
}
|
||||
|
||||
public string GetEnvFilePath()
|
||||
{
|
||||
return envFilePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user