HOWTO: find not found config.custom variables in one line

The following line finds “config.custom” keys not in code, it doesn’t detect commented usages.

for i in $(cat package.json | jq --raw-output '.config.custom | keys | .[]'); do \
    ag $i 1>/dev/null 2>&1 || echo $i; \
done

This print’s theier usage:

for i in $(cat package.json | jq --raw-output '.config.custom | keys | .[]'); do \
    ag $i; \
done

You need to have silversearcher-ag and jq installed.

What part of Ghost is this related to?

When you use gscan with package.json where you have something like:

{
  "config": {
    "custom": {
      "key1": {},
      "key2": {}
    }
  }
}

atm. gscan doesn’t report which keys are affected.

swappy-20240503_070939

A better answer, to theme development.

Thanks for clarifying!