mirror of https://github.com/einverne/dotfiles.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
574 B
26 lines
574 B
4 years ago
|
log = hs.logger.new('autoscript', 'debug')
|
||
|
local cmdArr = {
|
||
|
"cd /Users/einverne/Sync/wiki/ && /bin/bash auto-push.sh",
|
||
|
}
|
||
|
|
||
|
function shell(cmd)
|
||
|
hs.alert.show("execute")
|
||
|
log.i('execute')
|
||
|
output, status, t, rc = hs.execute(string.format("%s", cmd), true)
|
||
|
-- result, output, err = hs.osascript.applescript(string.format('do shell script "%s"', cmd))
|
||
|
log.i(output)
|
||
|
log.i(status)
|
||
|
log.i(t)
|
||
|
log.i(rc)
|
||
|
end
|
||
|
|
||
|
function runAutoScripts()
|
||
|
for key, cmd in ipairs(cmdArr) do
|
||
|
shell(cmd)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
|
||
|
myTimer = hs.timer.doEvery(1800, runAutoScripts)
|
||
|
myTimer:start()
|