mirror of
https://github.com/BioArchLinux/Rosa.git
synced 2025-03-10 12:02:43 +00:00
fix: adjust
This commit is contained in:
parent
be34cdf506
commit
48fa45da8f
1 changed files with 4 additions and 9 deletions
|
@ -2,24 +2,19 @@
|
||||||
|
|
||||||
local lfs = require("lfs")
|
local lfs = require("lfs")
|
||||||
|
|
||||||
local rosalua = "/usr/share/lilac/Rosa/rosa.lua"
|
|
||||||
local filepath = "/usr/share/lilac/Repo/x86_64/bioarchlinux.files" -- what I watch
|
|
||||||
local last_modified = nil
|
local last_modified = nil
|
||||||
local attr = lfs.attributes(filepath)
|
|
||||||
last_modified = attr.modification
|
|
||||||
|
|
||||||
--watch file--
|
--watch file--
|
||||||
local function check_changes()
|
local function check_changes()
|
||||||
-- current time
|
-- current time
|
||||||
local attr = lfs.attributes(filepath)
|
local current_modified = os.date("%c", lfs.attributes("/usr/share/lilac/Repo/x86_64/bioarchlinux.files").modification)
|
||||||
local current_modified = attr.modification
|
|
||||||
-- if different
|
-- if different
|
||||||
if current_modified ~= last_modified then
|
if current_modified ~= last_modified then
|
||||||
-- update info
|
|
||||||
last_modified = current_modified
|
|
||||||
-- run script
|
-- run script
|
||||||
print("Executing Rosa Lua")
|
print("Executing Rosa Lua")
|
||||||
os.execute("lua " .. rosalua)
|
os.execute("/usr/bin/lua /usr/share/lilac/Rosa/rosa.lua")
|
||||||
|
-- update info
|
||||||
|
last_modified = current_modified
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue