Is your feature request related to a problem? Please describe.
We have a bunch of Python scripts that we use for bulk creation and processing of many files in our docs project. We can open a terminal and run them from the command line, but it would be nice to have a button on the dashboard for triggering the script to run and define a UI (like we have for snippets) to enter values to be passed as arguments into the script execution command.
Describe the solution you'd like
Expand the 'Scripts' feature to define a command line execution string with placeholders and UI to enter them. Then show a button on the dashboard to trigger that UI and subsequent execution. This would expand the tool to allow for the execution of any script from any language and not limited to javascript/node scripts.
Describe alternatives you've considered
Opening the terminal and entering the script and arguments manually. With some reference to the command documentation to make sure you get the arguments right.
**Is your feature request related to a problem? Please describe.**
We have a bunch of Python scripts that we use for bulk creation and processing of many files in our docs project. We can open a terminal and run them from the command line, but it would be nice to have a button on the dashboard for triggering the script to run and define a UI (like we have for snippets) to enter values to be passed as arguments into the script execution command.
**Describe the solution you'd like**
Expand the 'Scripts' feature to define a command line execution string with placeholders and UI to enter them. Then show a button on the dashboard to trigger that UI and subsequent execution. This would expand the tool to allow for the execution of any script from any language and not limited to javascript/node scripts.
**Describe alternatives you've considered**
Opening the terminal and entering the script and arguments manually. With some reference to the command documentation to make sure you get the arguments right.
<!-- github-sync-id:1226929766 -->
Thanks @bwklein, it makes sense to allow more types of scripts/languages. I will do some experimentation with Python.
Thanks @bwklein, it makes sense to allow more types of scripts/languages. I will do some experimentation with Python.
<!-- github-comment-id:1119406855 -->
@estruyf I could see bash scripts as useful too since you could use them to execute other scripts in different languages as well.
@estruyf I could see bash scripts as useful too since you could use them to execute other scripts in different languages as well.
<!-- github-comment-id:1120040276 -->
nodeBin property will be deprecated in favor of the new command property.
Hi @zivbk1 have been working on the ability to run other types of scripts.
```json
{
"frontMatter.custom.scripts": [
{
"title": "Node script 1",
"script": "./scripts/node-test.js",
"command": "~/.nvm/versions/node/v16.11.1/bin/node"
},
{
"title": "Node script 2",
"script": "./scripts/node-test.js",
"command": "node"
},
{
"title": "Bash script",
"script": "./scripts/bash-test.sh",
"command": "bash"
},
{
"title": "Python script",
"script": "./scripts/python-test.py",
"command": "python3"
}
]
}
```
`nodeBin` property will be deprecated in favor of the new `command` property.
<!-- github-comment-id:1122474170 -->
Very clean and easy to use.
Would it be possible to add a UI like snippets, to pass arguments into variable placeholders within the 'script' string?
`"script": "./scripts/python-test.py -v [[version]]",`
<!-- github-comment-id:1122508684 -->
If there would be a UI, would you run more general scripts from it? Or do you also want to use it for content and media scripts?
If there would be a UI, would you run more general scripts from it? Or do you also want to use it for content and media scripts?
<!-- github-comment-id:1124697860 -->
I could see a use for user input whenever a script is run. Maybe every script doesn't need input, but the option could be very useful. For variables in a script that could change from run to run, UI would be better that editing the script code.
I could see a use for user input whenever a script is run. Maybe every script doesn't need input, but the option could be very useful. For variables in a script that could change from run to run, UI would be better that editing the script code.
<!-- github-comment-id:1125049598 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Is your feature request related to a problem? Please describe.
We have a bunch of Python scripts that we use for bulk creation and processing of many files in our docs project. We can open a terminal and run them from the command line, but it would be nice to have a button on the dashboard for triggering the script to run and define a UI (like we have for snippets) to enter values to be passed as arguments into the script execution command.
Describe the solution you'd like
Expand the 'Scripts' feature to define a command line execution string with placeholders and UI to enter them. Then show a button on the dashboard to trigger that UI and subsequent execution. This would expand the tool to allow for the execution of any script from any language and not limited to javascript/node scripts.
Describe alternatives you've considered
Opening the terminal and entering the script and arguments manually. With some reference to the command documentation to make sure you get the arguments right.
Thanks @bwklein, it makes sense to allow more types of scripts/languages. I will do some experimentation with Python.
@estruyf I could see bash scripts as useful too since you could use them to execute other scripts in different languages as well.
Hi @zivbk1 have been working on the ability to run other types of scripts.
nodeBinproperty will be deprecated in favor of the newcommandproperty.Very clean and easy to use.
Would it be possible to add a UI like snippets, to pass arguments into variable placeholders within the 'script' string?
"script": "./scripts/python-test.py -v [[version]]",If there would be a UI, would you run more general scripts from it? Or do you also want to use it for content and media scripts?
I could see a use for user input whenever a script is run. Maybe every script doesn't need input, but the option could be very useful. For variables in a script that could change from run to run, UI would be better that editing the script code.
It will be released in v7.3.0. I will create another issue to implement the script dashboard.