castor icon indicating copy to clipboard operation
castor copied to clipboard

Feature request: make fs() context aware

Open tacman opened this issue 2 months ago • 3 comments

https://castor.jolicode.com/going-further/helpers/filesystem/#filesystem

Is there a way to make fs() context aware

run('bin/console make:controller App -n");
$phpSource = fs()->readFile(context()->workingDirectory . '/src/Controller/AppController.php');

# Preferred:
$phpSource = fs()->readFile('/src/Controller/AppController.php');

What's the best way to handle this situation, without prepending the working directory to the path?

tacman avatar Oct 21 '25 18:10 tacman

This is not possible at the moment. We like the idea but - as we discussed it internally - we concluded that it would probably require some internal hacks. We might eventually make this possible in the future, but no ETA to expect for now.

pyrech avatar Nov 06 '25 15:11 pyrech

Thanks for your consideration. I can understand how complicated it might be!

tacman avatar Nov 06 '25 16:11 tacman

Let us keep this one open. It's a good idea. Thanks for the discussion 🤗

lyrixx avatar Nov 06 '25 16:11 lyrixx