Build command not applying with netlify dev

I’m using a build command with sed to apply a env variable to my build like so:

[build]
command = "echo \"${LOCATION}\" && sed -i 's#FOO#'\"${LOCATION}\"'#g' netlify.toml  && npm run build"

[[redirects]]
  from = "/api/*"
  to = "FOO/api/:splat"
  status = 200
  force = true

This seems to be working fine in production, but when I’m running locally with netlify dev it seems like the build command is not affecting the redirect URL (as in I see Rewrote URL to /FOO/api/something)

I’m new to netlify, so I’m not even sure if this should work. Thoughts?

I don’t think this is supposed to work locally. What’s keeping you from hardcoding the location? It’s not clear what your reason is for using this kind of a setup. Mind clarifying that?