mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 02:17:52 +02:00
Update druid editor scripts to run from dependency
This commit is contained in:
parent
e1ce982043
commit
102d8ca579
@ -9,6 +9,20 @@ local function ends_with(str, ending)
|
||||
end
|
||||
|
||||
|
||||
local function save_file_from_dependency(dependency_file_path, output_file_path)
|
||||
local content = editor.get(dependency_file_path, "text")
|
||||
local file, err = io.open(output_file_path, "w")
|
||||
if err then
|
||||
print("Error:", err)
|
||||
return false
|
||||
end
|
||||
file:write(content)
|
||||
file:close()
|
||||
print("Write file at", output_file_path)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
function M.get_commands()
|
||||
return {
|
||||
{
|
||||
@ -57,12 +71,15 @@ function M.get_commands()
|
||||
run = function(opts)
|
||||
local file = opts.selection
|
||||
print("Run script for", editor.get(file, "path"))
|
||||
save_file_from_dependency('/druid/editor_scripts/run_python_script_on_gui.sh', "./build/run_python_script_on_gui.sh")
|
||||
save_file_from_dependency('/druid/editor_scripts/setup_layers.py', "./build/setup_layers.py")
|
||||
return {
|
||||
{
|
||||
action = "shell",
|
||||
command = {
|
||||
"bash",
|
||||
"./editor_scripts/setup_layers.sh",
|
||||
"./build/run_python_script_on_gui.sh",
|
||||
"./build/setup_layers.py",
|
||||
"." .. editor.get(file, "path")
|
||||
}
|
||||
}
|
||||
@ -87,12 +104,16 @@ function M.get_commands()
|
||||
run = function(opts)
|
||||
local file = opts.selection
|
||||
print("Run script for", editor.get(file, "path"))
|
||||
save_file_from_dependency('/druid/editor_scripts/run_python_script_on_gui.sh', "./build/run_python_script_on_gui.sh")
|
||||
save_file_from_dependency('/druid/editor_scripts/create_druid_component.py', "./build/create_druid_component.py")
|
||||
save_file_from_dependency('/druid/editor_scripts/component.lua_template', "./build/component.lua_template")
|
||||
return {
|
||||
{
|
||||
action = "shell",
|
||||
command = {
|
||||
"bash",
|
||||
"./editor_scripts/create_druid_component.sh",
|
||||
"./build/run_python_script_on_gui.sh",
|
||||
"./build/create_druid_component.py",
|
||||
"." .. editor.get(file, "path")
|
||||
}
|
||||
}
|
@ -12,4 +12,4 @@ if [ -z "$is_defree_installed" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
python3 $DIR/create_druid_component.py $@
|
||||
python3 $1 $2
|
@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
# @license MIT, Insality 2021
|
||||
# @source https://github.com/Insality/druid
|
||||
|
||||
echo "Run bash for $1"
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
is_defree_installed=$(pip3 list --disable-pip-version-check | grep -E "deftree")
|
||||
if [ -z "$is_defree_installed" ]; then
|
||||
echo "The python deftree is not installed. Please install it via"
|
||||
echo "pip3 install deftree"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
python3 $DIR/setup_layers.py $@
|
BIN
manifest.private.der
Normal file
BIN
manifest.private.der
Normal file
Binary file not shown.
BIN
manifest.public.der
Normal file
BIN
manifest.public.der
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user