mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-04-18 05:22:11 +00:00
Fix test shell
This commit is contained in:
parent
3801510731
commit
168ee3c269
@ -2,33 +2,28 @@ import Foundation
|
|||||||
import Cocoa
|
import Cocoa
|
||||||
|
|
||||||
struct ShellConfigurationController {
|
struct ShellConfigurationController {
|
||||||
|
|
||||||
let socketPath = (NSHomeDirectory().replacingOccurrences(of: "com.maxgoedjen.Secretive.Host", with: "com.maxgoedjen.Secretive.SecretAgent") as NSString).appendingPathComponent("socket.ssh") as String
|
let socketPath = (NSHomeDirectory().replacingOccurrences(of: "com.maxgoedjen.Secretive.Host", with: "com.maxgoedjen.Secretive.SecretAgent") as NSString).appendingPathComponent("socket.ssh") as String
|
||||||
|
|
||||||
var shellInstructions: [ShellConfigInstruction] {
|
var shellInstructions: [ShellConfigInstruction] {
|
||||||
[
|
[
|
||||||
ShellConfigInstruction(shell: "test",
|
ShellConfigInstruction(shell: "zsh",
|
||||||
shellConfigDirectory: "~/",
|
shellConfigDirectory: "~/",
|
||||||
shellConfigFilename: ".test",
|
shellConfigFilename: ".zshrc",
|
||||||
text: "export SSH_AUTH_SOCK=\(socketPath)"),
|
text: "export SSH_AUTH_SOCK=\(socketPath)"),
|
||||||
|
ShellConfigInstruction(shell: "bash",
|
||||||
// ShellConfigInstruction(shell: "zsh",
|
shellConfigDirectory: "~/",
|
||||||
// shellConfigDirectory: "~/",
|
shellConfigFilename: ".bashrc",
|
||||||
// shellConfigFilename: ".zshrc",
|
text: "export SSH_AUTH_SOCK=\(socketPath)"),
|
||||||
// text: "export SSH_AUTH_SOCK=\(socketPath)"),
|
ShellConfigInstruction(shell: "fish",
|
||||||
ShellConfigInstruction(shell: "bash",
|
shellConfigDirectory: "~/.config/fish",
|
||||||
shellConfigDirectory: "~/",
|
shellConfigFilename: "config.fish",
|
||||||
shellConfigFilename: ".bashrc",
|
text: "set -x SSH_AUTH_SOCK=\(socketPath)"),
|
||||||
text: "export SSH_AUTH_SOCK=\(socketPath)"),
|
]
|
||||||
ShellConfigInstruction(shell: "fish",
|
|
||||||
shellConfigDirectory: "~/.config/fish",
|
|
||||||
shellConfigFilename: "config.fish",
|
|
||||||
text: "set -x SSH_AUTH_SOCK=\(socketPath)"),
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func addToShell(shellInstructions: ShellConfigInstruction) -> Bool {
|
func addToShell(shellInstructions: ShellConfigInstruction) -> Bool {
|
||||||
let openPanel = NSOpenPanel()
|
let openPanel = NSOpenPanel()
|
||||||
// This is sync, so no need to strongly retain
|
// This is sync, so no need to strongly retain
|
||||||
@ -59,5 +54,5 @@ struct ShellConfigurationController {
|
|||||||
handle.write("\n# Secretive Config\n\(shellInstructions.text)\n".data(using: .utf8)!)
|
handle.write("\n# Secretive Config\n\(shellInstructions.text)\n".data(using: .utf8)!)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user