microsoft/just

Could not use variable in task name

saravanan10393 opened this issue · 0 comments

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)