mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Solve #119 Add script for create custom component
This commit is contained in:
@@ -68,6 +68,36 @@ function M.get_commands()
|
||||
}
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
label = "Create Druid Component",
|
||||
|
||||
locations = {"Edit"},
|
||||
|
||||
query = {
|
||||
selection = {type = "resource", cardinality = "one"}
|
||||
},
|
||||
|
||||
active = function(opts)
|
||||
local path = editor.get(opts.selection, "path")
|
||||
return ends_with(path, ".gui")
|
||||
end,
|
||||
|
||||
run = function(opts)
|
||||
local file = opts.selection
|
||||
print("Run script for", editor.get(file, "path"))
|
||||
return {
|
||||
{
|
||||
action = "shell",
|
||||
command = {
|
||||
"bash",
|
||||
"./editor_scripts/create_druid_component.sh",
|
||||
"." .. editor.get(file, "path")
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
||||
|
Reference in New Issue
Block a user