Make --from-default-profile replace an existing custom profile

Repeated rescue runs such as `dsh rescue --from-default-profile web` failed
because the target profile already existed. The option now assembles a fresh
template copy in a staging directory, moves it over the target, and deletes the
previous profile; a failed move restores it.
This commit is contained in:
Turtle committed 2026-10-14 11:56:17 +08:00
1 parent a2486e8243
commit 8843c37e37
24 files changed
+197 -103

No files matched your search

+2 -2
View File
@@ -12,8 +12,8 @@
en: 1c59ba70e2d643ea
zh: 403667f567bcc77c
/package-and-install-a-plugin/two-concepts-two-manifests/the-profile-manifest:
en: e2bd00d8de99da67
zh: e70b17787bdb53a5
en: 00c4218e1af87e9d
zh: bd49e41ae376606c
/package-and-install-a-plugin/install-into-a-profile:
en: 78baf6471bd6e82b
zh: 0453a7d35fd57399
+1 -1
View File
@@ -70,7 +70,7 @@ A profile directory holds two files:
- `package.json` — the profile's out-of-tree plugin dependencies (managed by pnpm) plus the `dsh.profile` manifest with its ordered `bundles` list.
- `cordis.patch.yml` — the user's own patch layer, applied after every bundle layer.
You never write a profile manifest by hand: `dsh --profile <name> --from-default-profile <template>` can create one from a shipped application template, while `dsh plugin` creates a base-backed profile and maintains its installed bundle list. The [CLI behavior reference](../../../../apps/cli/reference/README.md#profile-boot) owns the creation rules; the next section shows the plugin path.
You never write a profile manifest by hand: `dsh --profile <name> --from-default-profile <template>` can create or reset one from a shipped application template, while `dsh plugin` creates a base-backed profile and maintains its installed bundle list. The [CLI behavior reference](../../../../apps/cli/reference/README.md#profile-boot) owns the creation rules; the next section shows the plugin path.
## Install into a profile
+1 -1
View File
@@ -70,7 +70,7 @@ profile 目录包含两个文件:
- `package.json` — profile 的树外插件依赖(由 pnpm 管理),加上 `dsh.profile` manifest 及其有序的 `bundles` 列表。
- `cordis.patch.yml` — 用户自己的 patch 层,在每个组合包层之后应用。
profile manifest 从不需要手写:`dsh --profile <name> --from-default-profile <template>` 可以从随附应用模板创建 profile,`dsh plugin` 则创建一个以 base 为基础的 profile,并维护其中已安装的 bundle 列表。创建规则以 [CLI(命令行界面)行为参考](../../../../apps/cli/reference/README.zh.md#profile-boot)为准;下一节展示插件路径。
profile manifest 从不需要手写:`dsh --profile <name> --from-default-profile <template>` 可以从随附应用模板创建或重置 profile,`dsh plugin` 则创建一个以 base 为基础的 profile,并维护其中已安装的 bundle 列表。创建规则以 [CLI(命令行界面)行为参考](../../../../apps/cli/reference/README.zh.md#profile-boot)为准;下一节展示插件路径。
## 安装进 profile