Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch workspace via shortcuts #443

Closed
tengstrand opened this issue Feb 27, 2024 · 0 comments
Closed

Switch workspace via shortcuts #443

tengstrand opened this issue Feb 27, 2024 · 0 comments

Comments

@tengstrand
Copy link
Collaborator

tengstrand commented Feb 27, 2024

Add support for switching workspace via shortcuts that are specified in the :ws-shortcuts key in the user config file ~/.config/polylith/config.edn (the value of :root-dir is added to the paths), e.g.:

{...
 :ws-shortcuts {:root-dir "/Users/joakimtengstrand/source/polylith"
                :paths [{:dir "examples/doc-example"}
                        {:dir "examples/multiple-workspaces2/backend"}
                        {:dir "../clojure-polylith-realworld-example-app" :name "realworld"}
                        {:file "../sandbox/another-ws.edn"}]
}

Now we can switch workspace with via:NAME where NAME is the name of the directory/file, or :name if given, e.g.:

polylith$ switch-ws via:
backend       (examples/multiple-workspaces2/backend)
doc-example                    (examples/doc-example)
realworld (../clojure-polylith-realworld-example-app)
another-ws (../sandbox/another-ws.edn)

If we for example select realworld then the tool will perform a switch-ws dir:../clojure-polylith-realworld-example-app for us:

polylith$ switch-ws via:realworld
dir:clojure-polylith-realworld-example-app$

We can always switch back to the root workspace with:

dir:clojure-polylith-realworld-example-app$ switch-ws
polylith$

It's also possible to switch to a workspace that has been exported to a file:

polylith$ switch-ws via:another-ws
file:another-ws$
tengstrand pushed a commit that referenced this issue Feb 27, 2024
tengstrand added a commit that referenced this issue Feb 27, 2024
Issue #443
* Support via-file and via-dir in the switch-ws command.
* New sponsor.
tengstrand added a commit that referenced this issue Mar 2, 2024
issue #443
* Use absolute paths in switch-ws, wia-dir/file, where we add the value of :ws-shortcuts-root-dir to the path.
* Moved in the :root-dir into :ws-shortcuts.
* 0.2.20-SNAPSHOT 5
@tengstrand tengstrand mentioned this issue Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant