refactor for pkexec

This commit is contained in:
itwrx
2023-07-14 18:02:17 -05:00
parent b183de6a93
commit 959bb7305f
4 changed files with 19 additions and 43 deletions

View File

@@ -4,7 +4,6 @@ EZ-Bkup is released under the General Public License 3.0.
See COPYING or <https://www.gnu.org/licenses/> for details.]#
import logging, times, os
#import "models/routine"
let appPath* = getHomeDir() & ".ez-bkup"
let databasePath* = appPath & "/ez-bkup.sqlite"
@@ -15,7 +14,6 @@ if not dirExists(appPath):
var logger = newFileLogger(appPath & "/errors.log")
let dt = now()
let nowDT* = dt.format("M-d-YYYY h:mm:ss tt")
#var logMsg: string
proc writeErrorToLog*(logMsg: string) =
logger.log(lvlError, logMsg)
@@ -24,22 +22,4 @@ proc writeInfoToLog*(logMsg: string) =
logger.log(lvlInfo, logMsg)
proc hasCommas*(filename: string):bool =
',' in filename
proc getAskPassPath*(): string =
var askPassPath: string
if fileExists("/usr/libexec/openssh/ssh-askpass"):
askPassPath = "/usr/libexec/openssh/ssh-askpass"
elif fileExists("/usr/lib/ssh/x11-ssh-askpass"):
askPassPath = "/usr/lib/ssh/x11-ssh-askpass"
elif fileExists("/usr/lib/ssh/gtk-ssh-askpass"):
askPassPath = "/usr/lib/ssh/gtk-ssh-askpass"
elif fileExists("/usr/lib/ssh/ssh-askpass"):
askPassPath = "/usr/lib/ssh/ssh-askpass"
else:
askPassPath = ""
return askPassPath
',' in filename