Newshot
Account

Vercel CLI 支持部署新项目时设置自动过期

AI summary

Vercel CLI 现在可在部署新项目时为其设置过期时间,到期后项目会自动删除,无需手动清理原型和测试应用。使用 vercel deploy 时加上 --delete-project-after 参数并指定时长即可,支持 1h、1d、1w、2w 和 30d。该参数仅对新建项目生效,需升级到 v65.12.0 或更高版本。

Translation(model translation, not the source's own text)

现在,使用 Vercel CLI 部署新项目时,你可以将该项目设置为到期。到期项目会被自动删除,因此原型、演示和测试应用无需手动清理。

使用 vercel deploy 并加上 --delete-project-after 和时长参数:


        # Delete the new project after one dayvercel deploy --delete-project-after 1d
      

部署一个将在一天后到期的新项目

支持的时长为 1h、1d、1w、2w 和 30d,CLI 会打印出项目到期的日期和时间。该标志仅在 vercel deploy 创建项目时生效。如果你带着该标志部署到已有项目,其到期时间不会改变,CLI 会打印一条警告。

要移除项目的到期设置,请运行 vercel project keep:


        vercel project keep my-project
      

移除项目的到期设置

将 Vercel CLI 更新到 v65.12.0 或更高版本即可开始使用。在 vercel deploy 文档中了解更多。

Only about 507 characters could be extracted — the rest did not come through (common on sites that need scrolling or a login). Read the original for the full piece.

Published by Vercel Blog
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗