Skip to content

Issues With creatuity/magento2-interceptors #121

@sprankhub

Description

@sprankhub

Support for creatuity/magento2-interceptors has initially been added in #108 / 8028a16. Sometimes, we still need to manually remove generated/staticcache, so that plugin changes are being applied. I'll have a look into this in more detail, but first, I have a question about this code:

(defn- rm-creatuity-cache-area [area]
(let [cache-file-name (str "generated/staticcache/global_primary_" area "_compiled_plugins.php")]
(run! (fn [base-dir]
(let [cache-file (str base-dir cache-file-name)]
(when (fs/exists? cache-file)
(do
(log/notice "Removing creatuity interceptor cache file" cache-file)
(fs/rm cache-file))))) (mage/all-base-dirs))))
(defn- rm-creatuity-cache []
(run! #(let [cache-dir (str % "generated/staticcache/")]
(when (fs/dir? cache-dir)
(do
(log/notice "Removing creatuity interceptors cache" cache-dir)
(fs/rm-contents cache-dir)))) (mage/all-base-dirs)))
(defn- clean-creatuity-interceptor-cache [file]
(if-let [area (di-xml-area file)]
(rm-creatuity-cache-area area)
(rm-creatuity-cache)))

I don't know ClojureScript, but to me, it looks like it does two things:

  1. rm-creatuity-cache-area: Remove the area-specific compiled plugin file "generated/staticcache/global_primary_" area "_compiled_plugins.php".
  2. rm-creatuity-cache: Remove everything inside "generated/staticcache/".

But if we do 2, 1 is not needed at all, right? Am I missing something? 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions