Fix tilde paths
This commit is contained in:
parent
8feb35ed7d
commit
423a29bff2
5
nowopen
5
nowopen
@ -16,7 +16,8 @@
|
|||||||
-- sun: closed
|
-- 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
|
if arg[1] == '-w' or arg[1] == '--where' then
|
||||||
print(XDG_DATA_HOME..'/nowopen/businesshours')
|
print(XDG_DATA_HOME..'/nowopen/businesshours')
|
||||||
os.exit(0)
|
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.execute(editor.." "..XDG_DATA_HOME..'/nowopen/businesshours')
|
||||||
os.exit(0)
|
os.exit(0)
|
||||||
end
|
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
|
if not f then
|
||||||
print("Could not find config file.\n"
|
print("Could not find config file.\n"
|
||||||
.."Please create a config file in either "
|
.."Please create a config file in either "
|
||||||
|
Loading…
Reference in New Issue
Block a user