aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-01-20 18:13:22 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-01-20 18:13:22 -0500
commit423a29bff247ecce00bc5383b28fa7624ef67dcf (patch)
treeb09a76f5ae93c2205596df94ccfb15c6528ee05d
parent8feb35ed7d126df13ad935f8bf6c5e752f49724e (diff)
Fix tilde paths
-rwxr-xr-xnowopen5
1 files changed, 3 insertions, 2 deletions
diff --git a/nowopen b/nowopen
index b94eb6d..a3981b5 100755
--- a/nowopen
+++ b/nowopen
@@ -16,7 +16,8 @@
-- sun: closed
--
-local XDG_DATA_HOME = os.getenv("XDG_DATA_HOME") or "~/.local/share"
+local HOME = os.getenv("HOME")
+local XDG_DATA_HOME = os.getenv("XDG_DATA_HOME") or (HOME.."/.local/share")
if arg[1] == '-w' or arg[1] == '--where' then
print(XDG_DATA_HOME..'/nowopen/businesshours')
os.exit(0)
@@ -25,7 +26,7 @@ elseif arg[1] == '-e' or arg[1] == '--edit' then
os.execute(editor.." "..XDG_DATA_HOME..'/nowopen/businesshours')
os.exit(0)
end
-local f = io.open(XDG_DATA_HOME..'/nowopen/businesshours') or io.open('~/.businesshours')
+local f = io.open(XDG_DATA_HOME..'/nowopen/businesshours') or io.open(HOME..'/.businesshours')
if not f then
print("Could not find config file.\n"
.."Please create a config file in either "