mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-30 00:56:56 +13:00
More elevation fixes
This commit is contained in:
parent
872406fc4c
commit
90ce2de529
1 changed files with 12 additions and 2 deletions
|
@ -206,8 +206,18 @@ public class ScriptHelper {
|
|||
return file;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static String createAskPassScript(SecretValue pass, ShellControl parent, ShellDialect type) {
|
||||
public static String createAskPassScript(SecretValue pass, ShellControl parent) throws Exception {
|
||||
var scriptType = parent.getShellDialect();
|
||||
|
||||
// Fix for power shell as there are permission issues when executing a powershell askpass script
|
||||
if (parent.getShellDialect().equals(ShellDialects.POWERSHELL)) {
|
||||
scriptType = parent.getOsType().equals(OsType.WINDOWS) ? ShellDialects.CMD : ShellDialects.BASH;
|
||||
}
|
||||
|
||||
return createAskPassScript(pass, parent, scriptType);
|
||||
}
|
||||
|
||||
private static String createAskPassScript(SecretValue pass, ShellControl parent, ShellDialect type) throws Exception {
|
||||
var content = type.getScriptEchoCommand(pass.getSecretValue());
|
||||
var temp = parent.getTemporaryDirectory();
|
||||
var file = FileNames.join(temp, "askpass-" + getScriptId() + "." + type.getScriptFileEnding());
|
||||
|
|
Loading…
Reference in a new issue