Repository navigation
fix: Use text script rather than fixed script paths - #789
Conversation
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
|
@spydon Thanks for the approve. I have little time to improve this with some potential tests. If you think it's fine then I will mark this as ready. |
I think it's fine, it looks like it makes sense and I assume you've tested it manually. |
|
Hi @spydon. I'm still seeing the old style of generated configurations. I saw the commit was published in v6.3.2 and I was using the exact same version. Is there something missing from the publish? EDIT: I just found out that I need to upgrade the workspace dependency! Sorry for disturbing. |
|
Hey @AlexV525, everything should be out. |
|
Have you tried if it works on the 7.0.0 pre-release version? |
|
I just upgraded my workspace dependency and it seems working. I used to think that a globally activated package would ignore the resolved version in the workspace, but now it appears not. |
Ah yes, that is intentional, so that it always runs with the version that you've specified in the pubspec. |
…_CACHE remap Address review feedback: - Restore the SCRIPT_TEXT-based run configuration template from invertase#789 so melos keeps resolving from PATH. A fixed SCRIPT_PATH into the pub cache breaks shims, symlinks, and workspace installs, and writes machine-specific absolute paths into committed .idea files. - Revert the PUB_CACHE branch of getMelosBinForIde accordingly, and hoist the loop-invariant bin path computation out of writeMelosScripts. - Keep getMelosRoot generic: the templates probe now lives at the IntelliJ call site and is passed to applyPubCacheOverride as a parameter. - Validate the rewritten root: only remap when the probe subdirectory actually exists under PUB_CACHE, otherwise keep the resolved root so errors name a real path. - Guard paths already inside PUB_CACHE (prevents doubling a nested cache path), compare paths with p.equals instead of ==, absolutize a relative PUB_CACHE the way pub does, and skip the remap when no default cache location can be determined (HOME unset). - Drop the unused getPubCacheDirectory/defaultPubCacheDirectory helpers, reuse io.dart's dirExists (wrapped to treat unreadable paths as missing), and memoize the resolved melos root. - Test the remap against real directories, and assert that PUB_CACHE does not change the generated run configuration XML.
Description
The
melosexecutable path could be changed due to environment updates. Using a text script and letting the configuration run in the terminal can reduce the pain of checking out these configurations into version control.Type of Change
fix-- Bug fix (non-breaking change which fixes an issue)