Configure run scripts
Launch a workspace app, server, watcher, or test command from Conductor
Use a run script to launch your app, server, watcher, or test command from the Run button in Conductor.
Run scripts are useful for commands you run repeatedly while working in a workspace. For one-off commands, use the terminal or Big Terminal Mode.
Configure a run script
Open Repository Settings for the repository, then add a run script in the Scripts section.
Repository Settings apply to your machine. To share a run script with teammates, commit a conductor.json file instead.
Use a workspace port
When your project starts a local server, read CONDUCTOR_PORT so each workspace can run on its own port.
python3 -m http.server --port "$CONDUCTOR_PORT"Conductor runs the command from the workspace directory, available as CONDUCTOR_WORKSPACE_PATH.
Conductor allocates ten ports to each workspace: CONDUCTOR_PORT through CONDUCTOR_PORT+9. Use those ports for app servers, asset servers, test runners, or other local processes that need to run beside other workspaces.
For the full list of variables, see Conductor environment variables.
Stop other run scripts first
If your project cannot run multiple dev servers at once, use nonconcurrent mode. In this mode, starting a run script stops any other running run script first.
You can find this setting under Advanced in the Scripts section of Repository Settings. For the exact configuration field, see Scripts.
Run multiple processes
If your run script starts multiple processes, keep them in the same process group so Conductor can clean them up together. Use concurrently or a similar tool instead of backgrounding commands with &.
Install concurrently:
npm install --save-dev concurrentlyThen use it from your run script:
{
"scripts": {
"run": "concurrently \"npm run server\" \"npm run worker\""
}
}Avoid backgrounding processes:
{
"scripts": {
"run": "npm run server & npm run worker"
}
}When Conductor stops that script, the backgrounded server can keep running and hold ports, memory, or other resources.