--allow-live 用于 shopify 开发的终端命令

--allow-live terminal command for shopify development

因此,在 vs 代码终端中使用“themekit”时,我收到以下消息:

"This is the live theme on my-store. If you wish to make changes to it, then you will have to pass the --allow-live flag"

为了解决它,我在命令中添加了 --allow-live 标志并且它工作正常。(如堆栈溢出的其他答案中所述)

但是,虽然它确实解决了问题,但每次我尝试使用 theme watch 或 theme deploy 时,它都会反复要求我使用 --allow-live 标志。

在 google、youtube 和其他教程上研究 themekit 时,我发现即使其他开发人员不使用 --allow-live,它也能正常工作。

我也阅读了以下 shopify 文档- https://www.shopify.com/partners/blog/checksums

“theme watch --allow-live”与“theme watch”命令有何不同,我如何确保每次使用 themekit 时它都不会要求我添加标志。有没有一种方法可以自动允许实时更改,而无需每次我尝试使用 themekit 时手动添加标志。

--allow-live 仅在您处理实时主题时使用。

如果您不想使用 --allow-live,您必须创建一个开发主题并进行开发,那么就不需要该标志了。

请注意,此标志是最近(几个月前)添加的,因此您可能正在阅读不存在此标志的旧文档。

不能在实时主题上停止标记,这是一个预防规则,这样您就不会在不知道您正在处理它的情况下覆盖实时主题。

所以theme watchtheme watch --allow-live做了完全一样的事情,但是第二个只允许修改live主题。