Using relative paths in config does not work
See original GitHub issueI try to use relative paths in the workspace configuration to set the settings for the following two values
"settings": { "php-cs-fixer.executablePath": "./typo3/vendor/bin/php-cs-fixer", "php-cs-fixer.config": ".php_cs" ....
When I use the full path it works. But as this project may be checked out to various folders it is not possible to enter the full path. I also tried to use “${workspaceFolder}” but it does not work.
Any hints why this doesnt work, or how to achieve this? Thanks
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Relative path in configuration file
I tried this in configuration file: '.\Applications\MyFirstApp\MyFirstApp.exe', but its not working. I need a relative path that is working ...
Read more >How should software tools interpret relative paths in ...
We have exactly this problem: a command line tool that takes a path to a config file and acts upon certain files referenced...
Read more >File path formats on Windows systems
These "drive relative" paths are a common source of program and script logic errors. Assuming that a path beginning with a letter and...
Read more >Simple trick to work with relative paths in Python
The trick is to define a variable that calculate the absolute path to our root in a file and then import this variable...
Read more >Status - Bugs - Eclipse.org
This works with normal git, and the relative path should be based on the directory the git config file is location. But when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
You could use the
${workspaceRoot}
to get the absolute path to your root project then go into your vendor.In my case I used :
${workspaceRoot}/vendor/bin/php-cs-fixer
I’m wondering why this is not the recommended way to do it. Because when we are working on multiple projects, the version can be different in every project.
In addition, since I used https://github.com/kubawerlos/php-cs-fixer-custom-fixers I need to be in the context of my project because otherwise
->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
could not be resolved.‘’’ const pattern = /^${workspace(Root|Folder)}/; ‘’’ https://github.com/junstyle/vscode-php-cs-fixer/blob/master/extension.js#L76
workspaceRoot and workspaceFolder are the same value