This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch fix-spaces-in-windows
in repository https://gitbox.apache.org/repos/asf/openserverless-task.git


The following commit(s) were added to refs/heads/fix-spaces-in-windows by this 
push:
     new 1ba53a2  edit util
1ba53a2 is described below

commit 1ba53a23cbde13a1d19c8be4d91c9a0feddc8af2
Author: Michele Sciabarra <[email protected]>
AuthorDate: Sat Aug 16 11:27:31 2025 +0200

    edit util
---
 util/docopts.md  |  2 ++
 util/opsfile.yml | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/util/docopts.md b/util/docopts.md
index 23a3d97..7be4d1c 100644
--- a/util/docopts.md
+++ b/util/docopts.md
@@ -40,6 +40,7 @@ Usage:
   util remove-secret <args>...
   util list-secrets
   util ingress-type
+  util edit [<plugin>]
 ```
 
 ## Commands
@@ -61,6 +62,7 @@ Usage:
 -  remove-secret           remove one or multiple secrets to user metadata
 -  list-secrets            list secrets from user metadata
 -  ingress-type            return the ingress type
+-  edit                    edit (with vscode) the current tasks or a plugin
 ```
 
 ## Options
diff --git a/util/opsfile.yml b/util/opsfile.yml
index 85f0ac8..1f56ba4 100644
--- a/util/opsfile.yml
+++ b/util/opsfile.yml
@@ -224,3 +224,20 @@ tasks:
           traefik.io/ingress-controller) echo "traefik" ;;
           *) echo "unknown" ;;
         esac
+
+  edit:
+    desc: edit the current tasks or a plugin
+    silent: true
+    cmds:
+      - code --version >/dev/null || dir "please install VSCode and add the 
cli 'code' to your PATH"
+      - |
+        DIR="$OPS_ROOT"
+        if test -n "{{._plugin_}}"
+        then DIR="${OPS_HOME}/olaris-{{._plugin_}}"
+             if ! test -d "$DIR"
+             then echo "$DIR"
+                  echo "Plugin {{._plugin_}} not found - install it with ops 
-plugin <repo>"
+                  exit 1
+             fi
+        fi
+        code "$DIR"
\ No newline at end of file

Reply via email to