summaryrefslogtreecommitdiff
path: root/tools/luals
blob: e55465733aece519405dd80c1c8030f3e3176043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/lua5.3

function scripts (path)
	local out = io.popen (
		string.format ("find '%s' -maxdepth 1 -type f -iname \"[^_]*.lua\" | grep -ve s_", path)
	)
	return function()
		for file in out:lines() do
			return file
		end 
		return nil
	end
end

function ardour (v)
	 local newline = string.find (v['description'], '\n')
	 if newline then
	    io.write (string.format ("T:%s:N:%s:D:%s\n", v['type'], v['name'], string.sub (v['description'], 0, newline-1)))
	 else
	    io.write (string.format ("T:%s:N:%s:D:%s\n", v['type'], v['name'], v['description']))
	 end
end

for script in scripts ("share/scripts/") do
	loadfile (script)()
end