aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-03-27 18:20:59 +0100
committerHarald Eilertsen <haraldei@anduin.net>2021-03-27 18:20:59 +0100
commit3eadab9d18357c88b19e3f3b26a4d9040c217dd5 (patch)
tree2234dd759071b5f2b508472b41ed8fe1fdf7b9d8
parentef999817d7b8d46f87361cd69c13085d8a756023 (diff)
downloadairwindows-lv2-port-3eadab9d18357c88b19e3f3b26a4d9040c217dd5.tar.gz
airwindows-lv2-port-3eadab9d18357c88b19e3f3b26a4d9040c217dd5.tar.bz2
airwindows-lv2-port-3eadab9d18357c88b19e3f3b26a4d9040c217dd5.zip
LV2/makeplugin: Add --pristine cmd line arg.
This arg will make the plugin from scratch, throwing away any existing port of the same plugin.
-rwxr-xr-xplugins/LV2/makeplugin29
1 files changed, 25 insertions, 4 deletions
diff --git a/plugins/LV2/makeplugin b/plugins/LV2/makeplugin
index 04d3195..e8ff889 100755
--- a/plugins/LV2/makeplugin
+++ b/plugins/LV2/makeplugin
@@ -8,15 +8,35 @@ def make_param_assigns(ctrl_ports)
.join("\n ")
end
+def usage
+ puts "Usage: #{__FILE__} [--pristine] <PluginName>"
+ puts "\nFlags:\n"
+ puts "\t--pristine\t- Make pristine plugin (deletes existing if it exists)"
+ exit
+end
if ARGV.length < 1
- puts "Usage: #{__FILE__} <PluginName>"
- exit
+ usage
end
-root = File.dirname(__FILE__)
+opt = {}
+plugin_name = ''
+
+ARGV.each do |arg|
+ case arg
+ when /^--pristine$/
+ opt[:pristine] = true
+ else
+ plugin_name = arg
+ end
+end
-plugin_name = ARGV[0]
+if plugin_name.empty?
+ puts "Missing plugin name!"
+ usage
+end
+
+root = File.dirname(__FILE__)
target_dir = File.join(root, 'src', plugin_name)
template_dir = File.join(root, 'Template')
@@ -37,6 +57,7 @@ Templates = %w{
}
begin
+ FileUtils.remove_dir(target_dir) if opt[:pristine] and Dir.exist?(target_dir)
Dir.mkdir(target_dir)
plugin_ttl = MakePlugin::PluginDescriptionTemplate.new(template_dir, pi)