Description
Although profiles have Workspace associations, a non-default profile needs to be selected. I would love to see it conditionally and automatically happening when launching code
from a workspace (something in the spirit of Git conditional includes.
For instance, assume org1
and org2
profiles have been created and there are directories named org1
and org2
nested within a projects
directory. When executing code .
(without any arguments) within org1
directory (or within any nested directory), then code
will launch with the org1
profile (equivalent for executing code --profile org1 .
).
This could be easily done by wrapping code
with a simple script such as
#!/usr/bin/env bash
PROFILE="Default"
! [ "$PWD" = "${PWD#${HOME}/projects/org1}" ] && PROFILE=org1
! [ "$PWD" = "${PWD#${HOME}/projects/org2}" ] && PROFILE=org2
code --profile "$PROFILE" "@$"
But it would be lovely to not wrap code
and have it configured in the/a settings/file respectively.
Activity