<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: hs upload --clean deletes global module instances in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/hs-upload-clean-deletes-global-module-instances/m-p/971651#M38912</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/286738"&gt;@PDeT&lt;/a&gt;&amp;nbsp;Since you're managing your theme via local development, I'm not sure if this solution would work, but wanted to share just in case - &lt;A href="https://www.spacerockx.com/" target="_blank" rel="noopener"&gt;SpacerockX&lt;/A&gt; developed a tool to update theme versions without losing customizations. It's primarily for custom child themes built from marketplace themes where the child theme has files overwritten that wouldn't get the latest updates, so it looks at the coded files and makes the necessary changes to the child theme to remain compatible with the updates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 05 May 2024 18:06:30 GMT</pubDate>
    <dc:creator>Jnix284</dc:creator>
    <dc:date>2024-05-05T18:06:30Z</dc:date>
    <item>
      <title>hs upload --clean deletes global module instances</title>
      <link>https://community.hubspot.com/t5/CMS-Development/hs-upload-clean-deletes-global-module-instances/m-p/971592#M38910</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This might be interesting for others as well, hence I wanted to share the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the cli you can upload your files to hubspot. We do this in our CI/CD workflow whenever a developer commits something to git. However, the regular upload command does only upload and does not remove files that have been removed from our git repository.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the documentation I thought --clean would solve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;--clean                      Will cause upload to delete files in your HubSpot account that are not found locally.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I noticed that this option will remove any configured global modules... What it seems to do is whipe the entire theme and then re-upload it, in stead of checking if a file needs to be removed or not on a per file basis. This is unbelievable...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be clear: my global module files, nor the templates that include them are removed locally. They are just there. After the upload they are in the design manager as well, but when clicking on the 'Edit global module' button, it's clear that it has been reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I achieve that files that are no longer needed, can be removed from the design manager through the cli, but avoid deleting the global modules?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the --clean flag, I can update the global module code without issues. So if the upload command would check if remove or replace should be done on a per file basis, I think this can work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just found out that this has been reported in github without proper follow up: &lt;A href="https://github.com/HubSpot/hubspot-cli/issues/930" target="_blank" rel="noopener"&gt;https://github.com/HubSpot/hubspot-cli/issues/930&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 11:56:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/hs-upload-clean-deletes-global-module-instances/m-p/971592#M38910</guid>
      <dc:creator>PDeT</dc:creator>
      <dc:date>2024-05-05T11:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: hs upload --clean deletes global module instances</title>
      <link>https://community.hubspot.com/t5/CMS-Development/hs-upload-clean-deletes-global-module-instances/m-p/971651#M38912</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/286738"&gt;@PDeT&lt;/a&gt;&amp;nbsp;Since you're managing your theme via local development, I'm not sure if this solution would work, but wanted to share just in case - &lt;A href="https://www.spacerockx.com/" target="_blank" rel="noopener"&gt;SpacerockX&lt;/A&gt; developed a tool to update theme versions without losing customizations. It's primarily for custom child themes built from marketplace themes where the child theme has files overwritten that wouldn't get the latest updates, so it looks at the coded files and makes the necessary changes to the child theme to remain compatible with the updates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 18:06:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/hs-upload-clean-deletes-global-module-instances/m-p/971651#M38912</guid>
      <dc:creator>Jnix284</dc:creator>
      <dc:date>2024-05-05T18:06:30Z</dc:date>
    </item>
  </channel>
</rss>

