Skip to content

Switch workspace via shortcuts #443

@tengstrand

Description

@tengstrand

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$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions