Files
dcr/docs-crowdin-export/ru-RU/docs/commands/dependency-commands.mdx.mdx
2026-08-31 15:08:59 +08:00

54 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebar_label: Команды зависимостей (add, tree)
---
# Команды зависимостей
## `dcr add \<name> [source]`
Добавляет зависимость в `dcr.toml`.
```bash
dcr add fmt # поиск в реестре
dcr add mylib ../path/to/lib # путь как источник
dcr add mylib path:./lib # явный префикс пути
dcr add mylib git:https://github.com/user/repo # явный префикс git
dcr add mylib github:user/repo # сокращённая запись GitHub
dcr add mylib gitlab:user/repo # сокращённая запись GitLab
```
Префиксы источника:
* `path:` — локальный путь
* `git:` — URL адрес git-репозитория
* `github:` — расширение `https://github.com/\<user>/\<repo>`
* `gitlab:` — расширение `https://gitlab.com/\<user>/\<repo>`
* `http://` / `https://` / `git@` — полный URL
Флаги:
* `--branch \<name>` — git ветка
* `--tag \<name>` — git tag
* `--rev \<hash>` — git commit
Если источник не указан — DCR выполняет поиск в подключенных реестрах. A bare relative or absolute path is accepted as a path dependency.
## `dcr tree`
Показывает дерево зависимостей проекта.
```bash
dcr tree
```
Пример вывода:
```
my-app v0.1.0
├── fmt (registry)
│ └── spdlog (registry)
└── catch2 (registry)
```
В случае path зависимостей, рекурсивно отображает их собственные зависимости (из файла `dcr.toml`).