diff --git a/README.md b/README.md index 3b1a85bd..70997666 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,18 @@ The current workspace-, file-path, and front matter data will be passed as an ar ```javascript const arguments = process.argv; -const workspaceArg = arguments[2]; -const fileArg = arguments[3]; -const dataArg = arguments[4]; -const data = dataArg && typeof dataArg === "string" ? JSON.parse(dataArg) : null; + +if (arguments && arguments.length > 0) { + const workspaceArg = arguments[2]; // The workspace path + const fileArg = arguments[3]; // The file path + const frontMatterArg = arguments[4]; // Front matter data + + console.log(`The content returned for your notification.`); +} ``` +> A sample file can be found here: ![script-sample.js](./sample/script-sample.js) + The output of the script will be passed as a notification, and it allows you to copy the output. ![](./assets/custom-action-notification.png) diff --git a/sample/script-sample.js b/sample/script-sample.js new file mode 100644 index 00000000..e950e688 --- /dev/null +++ b/sample/script-sample.js @@ -0,0 +1,10 @@ + +const arguments = process.argv; + +if (arguments && arguments.length > 0) { + const workspaceArg = arguments[2]; // The workspace path + const fileArg = arguments[3]; // The file path + const frontMatterArg = arguments[4]; // Front matter data + + console.log(`The content returned for your notification.`); +} \ No newline at end of file