diff --git a/druid/editor_scripts/gui_scheme.editor_script b/druid/editor_scripts/druid.editor_script similarity index 62% rename from druid/editor_scripts/gui_scheme.editor_script rename to druid/editor_scripts/druid.editor_script index 3619d60..35e6944 100644 --- a/druid/editor_scripts/gui_scheme.editor_script +++ b/druid/editor_scripts/druid.editor_script @@ -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") } } diff --git a/druid/editor_scripts/create_druid_component.sh b/druid/editor_scripts/run_python_script_on_gui.sh similarity index 90% rename from druid/editor_scripts/create_druid_component.sh rename to druid/editor_scripts/run_python_script_on_gui.sh index 56e44f1..f76c34d 100644 --- a/druid/editor_scripts/create_druid_component.sh +++ b/druid/editor_scripts/run_python_script_on_gui.sh @@ -12,4 +12,4 @@ if [ -z "$is_defree_installed" ]; then exit 0 fi -python3 $DIR/create_druid_component.py $@ +python3 $1 $2 diff --git a/druid/editor_scripts/setup_layers.sh b/druid/editor_scripts/setup_layers.sh deleted file mode 100755 index 96a4617..0000000 --- a/druid/editor_scripts/setup_layers.sh +++ /dev/null @@ -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 $@ diff --git a/manifest.private.der b/manifest.private.der new file mode 100644 index 0000000..73a06b0 Binary files /dev/null and b/manifest.private.der differ diff --git a/manifest.public.der b/manifest.public.der new file mode 100644 index 0000000..ebf423a Binary files /dev/null and b/manifest.public.der differ