Skip to content

Explicit CWD #187

Description

@dlnr

On WSL Linux the generator widget does not resolve to the correct working directory. I've looked at the issue and it seems that the Yeoman environment is created without an explicit cwd.

If you add these lines to packages/generator-widget/bin.js it should be fine.

#!/usr/bin/env node
import { join, dirname } from "path";
import { fileURLToPath } from "url";
import chalk from "chalk";
import { createEnv } from "yeoman-environment";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

console.log(chalk.bold.blueBright("Initializing the widget generator..."));
const env = createEnv({ cwd: process.cwd() });
env.cwd = process.cwd();
env.register(join(__dirname, "./generators/app/index.js"), "@mendix/widget");

const args = process.argv.slice(2);
env.run(["@mendix/widget", ...args].join(" "));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions