components icon indicating copy to clipboard operation
components copied to clipboard

How to run a different hook command for each stage?

Open Lobosque opened this issue 2 years ago • 0 comments

Description

I want to run different build commands for my static website, depending on the stage. The following does not work, because the ${stage} is empty, even when explicitly setting the stage via the --stage cli parameter:

org: lobosque
app: foo-frontend
name: vue-starter
component: website

inputs:
  domain: ${param:domain}
  src:
    src: ./src
    hook: npm run build-${stage}
    dist: ./dist

Result:

Deploying...

 Error: Failed running "src.hook": "npm run build-${stage}" due to the following error: Command failed: npm run build-${stage}
npm ERR! missing script: build-

Lobosque avatar Sep 21 '21 15:09 Lobosque