Initial Commit

This commit is contained in:
Talia 2024-04-02 14:53:17 +02:00
commit 02cab39e47
3 changed files with 38 additions and 0 deletions

0
.luarc.json Normal file
View file

23
src/taskwarrior.lua Normal file
View file

@ -0,0 +1,23 @@
local json = require "cjson"
local taskwarrior = {}
local function shellescape(str)
return "'"..str:gsub([[']], [['"'"']]).."'"
end
function taskwarrior.import(...)
local filters = {...}
for i, filter in ipairs(filters) do
filters[i] = shellescape(filter)
end
return json.decode(io.popen("task "..table.concat(filters, " ").." export"):read("*a"))
end
function taskwarrior.export(items)
local handle = assert(io.popen("task import"))
handle:write(json.encode(items))
handle:close()
end
return taskwarrior

View file

@ -0,0 +1,15 @@
package = "taskwarrior"
version = "dev-1"
source = {
url = "git+https://git.but.gay/darkwiiplayer/taskwarrior-lua"
}
description = {
homepage = "https://git.but.gay/darkwiiplayer/taskwarrior-lua",
license = "Unlicense"
}
build = {
type = "builtin",
modules = {
taskwarrior = "src/taskwarrior.lua"
}
}