Skip to content

Base directory with config relative linking #381

@davidsneighbour

Description

@davidsneighbour

I have the following setup:

  • an arbitrary directory in which I want to run dotbot --config ./path/to/config.yaml
  • a repository that contains the config.yaml below which can be anywhere
  • a directory I want to link files from that repository to

I am not inside of the repository containing the config.yaml, and the files I want to link are relative to that config.yaml (same folder or subfolder).

Inside that config.yaml I do not know where I will be running the dotbot command.

The config is, for instance, this:

- link:
      # files
      .github/copilot-instructions.md: dotfiles/copilot/instructions-dotfiles.md

If I run

./dotbot/bin/dotbot --config-file ai/prompts/dotbot.yaml --base-directory .

It fails with a non-existent target error.

If I run the command without a base directory, it will link inside the repository.

I want to have a single file that I can link in multiple folders that I DO NOT know about in the config, into a local subdirectory based on where I run the dotbot command.

If I run it in ${HOME}/somedirectory I want to end up with ${HOME}/somedirectory/.github/..., if I run it in ${HOME} I want to end up with ${HOME}/.github/....

I fail to do this without using absolute paths in the config file. The --base-directory option expects an absolute path in the YAML file. Adding ./ on the left side of the link config line does not help (same error).

Is it possible to do that properly with dotbot or am I trying to use dotbot for something it is not intended to be used? I would expect to have multiple user directories on a station, one dotbot-config repo, and then install it to those users' home directories at least (which I then could "abuse" for my use case).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions