hi all Does anyone kno…

1 minute read

hi, all! Does anyone know if @nrwl/workspace:run-commands ensure that the array of commands passed as an option are executed in order? because i have this configuration ``` “build”: { “builder”: “@nrwl/workspace:run-commands”, “options”: { “commands”: [ { “command”: “npm run build-compose:scripts” }, { “command”: “npm run build-compose:nginx” }, { “command”: “npm run build-compose:docker-compose” },

          {
            "command": "npm run ensure-dir -- dist/scripts"
          },
          {
            "command": "npm run ensure-dir -- dist/nginx"
          },
          {
            "command": "npm run copy-files -- libs/compose/docker-compose.yml dist/docker-compose.yml"
          },
          {
            "command": "npm run copy-files -- libs/compose/scripts dist/scripts"
          },
          {
            "command": "npm run copy-files -- libs/compose/nginx dist/nginx"
          }
        ]
      },
      "configurations": {
        "production": {}
      }
    }``` and sometimes the ci shows me this output ```> ng build "compose"

> simplifi@0.0.0 ensure-dir /home/circleci/project > node ./scripts/ensure-dir.js “dist/nginx”

> simplifi@0.0.0 copy-files /home/circleci/project > node ./scripts/copy-files.js “libs/compose/docker-compose.yml” “dist/docker-compose.yml”

> simplifi@0.0.0 copy-files /home/circleci/project > node ./scripts/copy-files.js “libs/compose/scripts” “dist/scripts”

> simplifi@0.0.0 copy-files /home/circleci/project > node ./scripts/copy-files.js “libs/compose/nginx” “dist/nginx”

> simplifi@0.0.0 ensure-dir /home/circleci/project > node ./scripts/ensure-dir.js “dist/scripts”``` Notice the commands are not executed in the same order as the configuration

Responses:

I see this in the schema for that builder "parallel": { "type": "boolean", "description": "Run commands in parallel", "default": true },

so perhaps not? I’m no expert though

looking at the implementation a bit it looks like if you set parallel to false, you’ll get your commands executed in the same order they are in the configuration

awesome, thx!

i missed that option lol :sweat:

easy fix !

Updated: