anishathalye / anishathalye/dotbot

Base directory with config relative linking

未關閉
#381 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
8k
分支
320
PR 合併指標
30 天內沒有已合併 PR

描述

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

```bash
./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).

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。