From 5d7877963936f0a382e27e3160bbbb910f389fd0 Mon Sep 17 00:00:00 2001 From: francesco Date: Thu, 27 Jun 2024 16:23:06 +0200 Subject: [PATCH] add metadata --- bin/mush | 5 +++++ tests/bare/plugins/custom-command-test.sh | 12 ++++++++++++ tests/fixtures/basic-plugin/Manifest.toml | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 tests/bare/plugins/custom-command-test.sh diff --git a/bin/mush b/bin/mush index d743243..caf032b 100755 --- a/bin/mush +++ b/bin/mush @@ -73,6 +73,11 @@ main() { eval "set -- --help" fi + if [ "${1:0:1}" != "-" ] && command -v "mush-$1" >/dev/null 2>&1; then + "mush-$1" "$@" + exit $? + fi + eval "$(getoptions parser_definition parse "$0") exit 1" parse "$@" eval "set -- $REST" diff --git a/tests/bare/plugins/custom-command-test.sh b/tests/bare/plugins/custom-command-test.sh new file mode 100644 index 0000000..99f6538 --- /dev/null +++ b/tests/bare/plugins/custom-command-test.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e + +echo "==> Build: mush" +cp target/release/mush target/release/mush.test.sh +bash target/release/mush.test.sh build --release + +echo "==> Test: install basic-plugin" +cd tests/fixtures/basic-plugin +rm -fr bin lib libexec share target +bash ../../../target/release/mush -vvvvvvvvv install --path . +../../../target/release/mush basic-plugin diff --git a/tests/fixtures/basic-plugin/Manifest.toml b/tests/fixtures/basic-plugin/Manifest.toml index 7fcf1cd..bac6495 100644 --- a/tests/fixtures/basic-plugin/Manifest.toml +++ b/tests/fixtures/basic-plugin/Manifest.toml @@ -4,6 +4,14 @@ type = "plugin" version = "0.1.0" edition = "2022" +[[bin]] +name = "mush-plugin-command-1" +path = "src/main.rs" + +[[bin]] +name = "mush-plugin-command-2" +path = "src/other_command/main.rs" + # See more keys and their definitions at https://mush.javanile.org/manifest.html [dev-dependencies]