✨ Initial Commit ✨
This commit is contained in:
commit
02cab39e47
3 changed files with 38 additions and 0 deletions
0
.luarc.json
Normal file
0
.luarc.json
Normal file
23
src/taskwarrior.lua
Normal file
23
src/taskwarrior.lua
Normal 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
|
15
taskwarrior-dev-1.rockspec
Normal file
15
taskwarrior-dev-1.rockspec
Normal 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"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue