feat: add a shell function to check if a plugin trigger exists
This commit is contained in:
@@ -225,6 +225,19 @@ fn-is-valid-app-name-old() {
|
||||
return 1
|
||||
}
|
||||
|
||||
fn-plugn-trigger-exists() {
|
||||
declare desc="checks if a plugn trigger exists"
|
||||
declare TRIGGER_NAME="$1"
|
||||
local exists
|
||||
|
||||
exists="$("$PLUGIN_CORE_AVAILABLE_PATH/common/common" --quiet plugn-trigger-exists "$TRIGGER_NAME" || true)"
|
||||
if [[ "$exists" == "true" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
is_valid_app_name() {
|
||||
declare desc="verify that the app name matches naming restrictions"
|
||||
local APP="$1"
|
||||
|
||||
@@ -53,6 +53,13 @@ func main() {
|
||||
appName = "--global"
|
||||
}
|
||||
fmt.Print(common.GetAppScheduler(appName))
|
||||
case "plugn-trigger-exists":
|
||||
triggerName := flag.Arg(1)
|
||||
if common.PlugnTriggerExists(triggerName) {
|
||||
fmt.Print("true")
|
||||
} else {
|
||||
fmt.Print("false")
|
||||
}
|
||||
case "verify-app-name":
|
||||
appName := flag.Arg(1)
|
||||
err = common.VerifyAppName(appName)
|
||||
|
||||
Reference in New Issue
Block a user