diff --git a/CHANGELOG.md b/CHANGELOG.md index 262ea61a..442d5aaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Release 0.0.15 (Unreleased) +### Added + +- Added ability skip addons specified in file during install/update/upgrade. +- Added new options to `odood test` command: + - `--file` that could be used to pass the path to file to read addons to test from + - `--skip-file` read names of addons to skip from file + ### Changed - Installation of dependencies from manifest is now optional. diff --git a/subpackages/cli/source/odood/cli/commands/addons.d b/subpackages/cli/source/odood/cli/commands/addons.d index b0c8055c..a23be9c7 100644 --- a/subpackages/cli/source/odood/cli/commands/addons.d +++ b/subpackages/cli/source/odood/cli/commands/addons.d @@ -385,14 +385,19 @@ class CommandAddonsUpdateInstallUninstall: OdoodCommand { this.add(new Option( null, "dir-r", "Directory to recursively search for addons").repeating); + this.add( + new Option( + "f", "file", + "Read addons names from file (addon names must be separated by new lines)" + ).optional().repeating()); this.add(new Option( null, "skip", "Skip addon specified by name.").repeating); this.add(new Option( null, "skip-re", "Skip addon specified by regex.").repeating); this.add( new Option( - "f", "file", - "Read addons names from file (addon names must be separated by new lines)" + null, "skip-file", + "Skip addons listed in specified file (addon names must be separated by new lines)" ).optional().repeating()); this.add(new Argument( "addon", "Specify names of addons as arguments.").optional.repeating); @@ -409,6 +414,10 @@ class CommandAddonsUpdateInstallUninstall: OdoodCommand { string[] skip_addons = args.options("skip"); auto skip_regexes = args.options("skip-re").map!(r => regex(r)).array; + foreach(path; args.options("skip-file")) + foreach(addon; project.addons.parseAddonsList(Path(path))) + skip_addons ~= addon.name; + OdooAddon[] addons; foreach(search_path; args.options("dir")) foreach(addon; project.addons.scan(Path(search_path), false)) { diff --git a/subpackages/cli/source/odood/cli/commands/test.d b/subpackages/cli/source/odood/cli/commands/test.d index 454b5d7b..057acf80 100644 --- a/subpackages/cli/source/odood/cli/commands/test.d +++ b/subpackages/cli/source/odood/cli/commands/test.d @@ -69,12 +69,22 @@ class CommandTest: OdoodCommand { this.add(new Option( null, "dir-r", "Directory to recursively search for addons to test").repeating); + this.add( + new Option( + "f", "file", + "Read addons names from file (addon names must be separated by new lines)" + ).optional().repeating()); this.add(new Option( null, "skip", "Skip (do not run tests) addon specified by name.").repeating); this.add(new Option( null, "skip-re", "Skip (do not run tests) addon specified by regex.").repeating); + this.add( + new Option( + null, "skip-file", + "Skip addons listed in specified file (addon names must be separated by new lines)" + ).optional().repeating()); this.add(new Argument( "addon", "Name of addon to run tests for.").optional.repeating); @@ -93,6 +103,10 @@ class CommandTest: OdoodCommand { string[] skip_addons = args.options("skip"); auto skip_regexes = args.options("skip-re").map!(r => regex(r)).array; + foreach(path; args.options("skip-file")) + foreach(addon; project.addons.parseAddonsList(Path(path))) + skip_addons ~= addon.name; + OdooAddon[] addons; foreach(search_path; args.options("dir")) foreach(addon; project.addons.scan(Path(search_path), false)) { @@ -119,6 +133,13 @@ class CommandTest: OdoodCommand { addons ~= addon.get; } + foreach(path; args.options("file")) { + foreach(addon; project.addons.parseAddonsList(Path(path))) { + if (skip_addons.canFind(addon.name)) continue; + if (skip_regexes.canFind!((re, addon) => !addon.matchFirst(re).empty)(addon.name)) continue; + addons ~= addon; + } + } return addons; }