diff src/name/blackcap/imageprep/Settings.kt @ 5:884f1415a330

Rationalized directory management.
author David Barts <n5jrn@me.com>
date Fri, 17 Jul 2020 17:11:43 -0700
parents 5234e4500d45
children
line wrap: on
line diff
--- a/src/name/blackcap/imageprep/Settings.kt	Fri Jul 17 14:51:41 2020 -0700
+++ b/src/name/blackcap/imageprep/Settings.kt	Fri Jul 17 17:11:43 2020 -0700
@@ -9,22 +9,12 @@
 private val _PROPS = PROPERTIES
 
 object Settings {
-    private val homeDir = System.getProperty("user.home")
     var maxDimension = _PROPS.getProperty("maxDimension").toInt()
     var outputQuality = _PROPS.getProperty("outputQuality").toInt()
     var outputSuffix = _PROPS.getProperty("outputSuffix")
     var outputTo = tilde(_PROPS.getProperty("outputTo"))
     var outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir"))
 
-    private fun tilde(s: String?): String {
-        if (s.isNullOrEmpty())
-            return homeDir
-        if (s.startsWith("~/") || s.startsWith("~\\"))
-            return File(homeDir, s.substring(2).trimStart(s[1])).toString()
-        else
-            return s
-    }
-
     private fun strToBool(s: String): Boolean {
         if (s.isNullOrEmpty())
             return false