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

root directory must match OS specification #199

Open
gregveres opened this issue May 18, 2020 · 0 comments
Open

root directory must match OS specification #199

gregveres opened this issue May 18, 2020 · 0 comments

Comments

@gregveres
Copy link
Contributor

Is this a bug report or a feature request?

This is a bug report. I am on windows, but I was trying to follow your instructions for setting up the development environment. I went into cli.ts and I set my root to a unix type path (not wanting to have to escape every backslash in the path). Majestic found the tests and could run the tests, but the tree didn't show anything. Instead it showed my root path as the top level node and wouldn't let it expand.

I poked around the code and found that in project.ts, I could use path.normalize() on the root to convert it to the specification of the OS and then everything would work properly after that.

I will create a PR for this and you can decide if you want to accept it or not. Normalize will do nothing to the path if a proper path was specified. Normalize is really for getting rid of '..' embedded in the path.

With the code the way that it is, a single user on a single machine will be fine. But for a team environment where some users on Macs and some on Windows machines, they will be a little screwed because they can't check in their majestic configuration. But with this change, those people could check in a unix configuration and then the majestic code base would convert to the appropriate platform at run time through the normalize call.

Version Info

  • Version of Majestic: v1.7.0
  • Version of Jest: v25
  • Version of Node: v12.14.1
  • Operating System: windows 10

Reproduction Repo

On windows, set your root directory to the proper directory but use a unix style path. Then run from another directory to see the behaviour I mentioned above.

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