Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Commit

Permalink
TMPDIR Function bby
Browse files Browse the repository at this point in the history
  • Loading branch information
Azoy committed Mar 18, 2018
1 parent b7faa9b commit 97535a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion Sources/SwordRPC/SwordRPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class SwordRPC {
}

public func connect() {
let tmp = self.getTmpPath()
let tmp = NSTemporaryDirectory()

guard let socket = self.socket else {
print("[SwordRPC] Unable to connect")
Expand Down
22 changes: 0 additions & 22 deletions Sources/SwordRPC/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,6 @@
import Foundation

extension SwordRPC {

func getTmpPath() -> String {
let currentProcess = ProcessInfo.processInfo

if let path = currentProcess.environment["XDG_RUNTIME_DIR"] {
return path
}

if let path = currentProcess.environment["TMPDIR"] {
return path
}

if let path = currentProcess.environment["TMP"] {
return path
}

if let path = currentProcess.environment["TEMP"] {
return path
}

return "/tmp"
}

func encode(_ value: Any) -> Data {
do {
Expand Down

0 comments on commit 97535a2

Please sign in to comment.