Trailing slash breaks workspace features when yarn run inside workspace folder
#5816 opened on May 14, 2018
Description
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
When the workspaces definition contains a trailing slash, running e. g. yarn workspaces info in the root works just as expected. But when you cd into the workspace folder and run yarn workspaces info, it fails because it cannot detect that that folder is a workspace.
If the current behavior is a bug, please provide the steps to reproduce.
- Create a new project directory.
- Create a subdirectory called
package. yarn initinsidepackage/.yarn initin the root.- Add
package/(with trailing slash) as a workspace to the rootpackage.json.... "workspaces": { "packages": [ "package/" ], }, ... - Run
yarn workspaces infoin the root. => Outputs workspace list correctly. - Run
yarn workspaces infoinpackage/. => Fails withyarn workspaces v1.6.0 error Cannot find the root of your workspace - are you sure you're currently in a workspace? info Visit https://yarnpkg.com/en/docs/cli/workspaces for documentation about this command.
What is the expected behavior?
Running yarn workspaces info should output the workspaces when run both inside root and package/.
If this behavior is intended, the documentation could reflect the reason why.
Please mention your node.js, yarn and operating system version. Node v8.11.1 Yarn v1.6.0 Ubuntu 16.04 LTS