🏠 > 🧠 Core Concepts > 🔨 Task
Some tasks might require several pre-requisites.
For example, a typescript developer needs to install npm packages and compile their typescript before running/testing their application.
To start a typescript application, you need to do:
# prepare app
npm install
tsc
# start app
npm startwhile to test the application, you need to do:
# prepate app
npm install
tsc
# test app
npm testYou can make a zaruba script to execute those actions:
tasks:
prepareApp:
extend: zrbRunShellScript
configs:
start: npm install && tsc
startApp:
extend: zrbStartApp
dependencies:
- prepareApp
configs:
ports: 3000
start: npm start
testApp:
extend: zrbRunShellScript
dependencies:
- prepareApp
configs:
start: npm testThe scripts has some advantages:
- You can update
prepareAppwithout touchingstartAppandtestApp. - In case of you have many dependencies, Zaruba will run the dependencies in parallel.
Let's modify the script a little bit to run startApp and testApp in parallel:
tasks:
prepareApp:
extend: zrbRunShellScript
configs:
start: npm install && tsc
startApp:
extend: zrbStartApp
dependencies:
- prepareApp
configs:
ports: 3000
start: npm start
testApp:
extend: zrbRunShellScript
dependencies:
- prepareApp
configs:
start: npm test
startAndTestApp:
dependencies:
- startApp
- testAppCool. Now, whenever you run zaruba please startAndTestApp, things will be executed in this order:
