Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not use variable in task name #400

Open
saravanan10393 opened this issue Jun 14, 2020 · 0 comments
Open

Could not use variable in task name #400

saravanan10393 opened this issue Jun 14, 2020 · 0 comments

Comments

@saravanan10393
Copy link

I have 5 services, i want to register a same task for each service,, i tried as follows, but it breaks.

let { task, logger } = require("just-task");
let services = ["base", "account"];
for (let service in services) {
  task(`${service}-web`, function () {
    logger.info(`inside ${service} task`);
  });
}

task("build", series("base-web", "aocunt-web"));

when i run. the task build, it throughed the following error

15:00:36] x Invalid configuration file: /Users/Saravanan/projects/kf-xg-frontend/just.config.js
[15:00:36] x Error: AssertionError [ERR_ASSERTION]: Task never defined: base-web
    at getFunction (/Users/Saravanan/projects/kf-xg-frontend/node_modules/undertaker/lib/helpers/normalizeArgs.js:15:5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant