WebStorm run command or program on project open - webstorm

Is there any way to run external program or command after I open project in WebStorm?
I've created new external tool which runs database server, and after I click on it in menu, it runs the server and everything works, but I'd like to start this tool automatically on project start. And it'd be awesome if it could also open web browser to certain url which would be database admin tool.

If you can launch your desired task using Grunt/Gulp/npm task or any other Run/Debug Configuration then yes -- there is Startup Tasks functionality available at Settings/Preferences | Tools | Startup Tasks.
Note that you cannot execute External Tools entry directly or launch any DOS/shell command this way.
The easiest way of using this would be creating Grunt/Gulp task that would do your actual job. There you can use exec() method to execute custom command.

Related

Run AHK script as admin on startup

I have four AHK scripts which run on startup, as they have shortcuts placed in my startup folder. How can I make them run as admin?
What I've tried:
I've tried changing their properties to be run as admin, but they just don't run (when I do that).
I've tried changing their shortcuts' properties to be run as admin, but they too just don't run (when I do that).
I've looked at this reddit post on the topic, but I don't know how to implement that code in the scripts.
I've tried creating a basic C++ application which runs them with system("start path\\to\\script"), but it wouldn't compile.
In case it matters, the scripts in question are ahk-active-screenshot, CtrlAlt_Switch.ahk, Kill.ahk, and a modified version of this search script.
You can allow the script to automate administrative programs without running as admin, here're the required steps:
When installing AHK, check the "Add 'Run with UI Access' to context menus" option.
After installation, find AutoHotkeyU64_UIA.exe on your disk.
Open the .ahk script's properties, change the "Open with" option to the AutoHotkeyU64_UIA.exe you just found.
Create a shortcut to this script.
Open %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup in the file explorer.
Move that shortcut to this folder.
And you're done.
How does it work?
The "Add 'Run with UI Access' to context menus" option provides a workaround for common UAC-related issues by allowing the script to automate administrative programs without running as admin.
Reference: Run with UI Access.
Find the UIA version of autohotkey on your machine. For me it is at C:\Program Files\AutoHotkey\AutoHotkeyU64_UIA.exe.
In your startup folder, create a new shortcut (probably one for each of the scripts you want) as follows (replacing paths as appropriate):
Target: "C:\Program Files\AutoHotkey\AutoHotkeyU64_UIA.exe" "D:\path\to\script.ahk"
Start in: "C:\Program Files\AutoHotkey"
This launches your script as an admin using the UIA version of AHK on startup.

WebStorm, setting JavaScript Debug with another task running before

In WebStorm I can very easy setup JavaScript Debug and then when I run this configuration, IDE opens the Chrome browser and all breakpoints are active. The problem begins when I need to run specific tasks prior to starting debugging, for example running npm build script. When I define it in Before launch (see the picture below), the Chrome browser not being opened when I activate this debug configuration but being opened after I stop it.
This requires from me, manually run a project from command line and then run Browser Debug
Can I define the additional tasks in a way that Chrome will be opened as usually?
Thank you.
A process added to Before launch section has to return an exit code, the main process is waiting for it to start and thus doesn't start until the first process terminates. This is the way Before launch is designed - it's supposed to be used to run some sort of pre-processing before running the main process. You can add a build task (a script that builds your app and then exits) to this section; but start:dev likely doesn't exit, it starts the server your application is hosted on, and it has to be running to make your application work, doesn't it? Please remove your npm script from Before launch, start it separately or use the Compound configuration to start both npm script and Javascript Debug run configuration concurrently

GoCD - Task Plugins not adding tasks

I have setup a GoCD server and agent (on a Windows machine if that matters). I am using it to build a .NET application. I have installed a few Task plugins (Powershell, Xunit-converter) and when I restart the server I see those as loaded and installed without issue in the plugin admin screen.
However, when I go to create or edit a job, I do not see these new tasks in the "Add Task" dropdown. I can get around the powershell one by using a Custom command, but I need to be able to convert my MsTest ouptut to Xunit so that it can display the results in the Test Results Tab.

Configure Eclipse CDT not to launch external tool on unsuccessfull build

I am using Eclipse CDT on Linux to create console application. I configured External tool to launch more advanced terminal than internal Console window. Internal Eclipse console does not suit the style of application I am developing. However I can't find a way to configure Eclipse not to launch external tool if the build operation fails. Or other approach would be to remove binary from output folder, but only on unsuccessfull build. I can remove binary before every build to do that, but it would take more time on every launch to re-link. There is a Prompt option in normal Run mode, but i cannot itegrate my Shell script to launch my exterminal there. Advices on achieving such functionality?

Run configuration with command line program in IntelliJ IDEA

I would like to add a configuration inside IntelliJ so that I can run it from the Run context menu (there is included Node.JS launcher but I couldn't find a "Command Line configuration launcher")
Also, is it possible to run the command line terminal as Administrator if ran from Windows ?
The command I would like to run is ember serve
Thanks for the help.
These are the steps:
Go to Run/Edit Configurations...
Add a new one for "Javascript Debug"
Fill Name with the name you want for the configuration, fill the URL with http://localhost:4200 and pick the browser you prefer
Then, in the second white box, add an external tool by clicking in the green plus button and selecting the option Run External tool
Add a new one clicking on the green plus button and fill the following fields: in Name the name you want for the external tool, in Program write ember (it's the command you are going to run), in Parameters write server or s as the options for the command and in Working directory write $ProjectFileDir$ if it's not written already to run it in the folder in which you are working with.
With all this, you should only need to press the play button and it should run and open the browser automatically with a tab directing to localhost:4200, where your ember server is running.
EDIT: I'm not using it on windows so I'm not sure if it will run the command as administrator. Probably running Intellij using "Run as Administrator" will do the job.