Last year i created a worker that was published with 2 dash environments (staging and production)
Recently i updated the code to use wrangler2 with publish command and what this did was generate a new worker in cloudflare based on the --env flag provided
"wrangler publish --env production", this was not what i wanted (2 workers instead of 1, resulting in 3 workers where one is the older legacy that is bound to a durable object per legacy environment to make things worse).
The problem is that i want to overwrite the old worker for each environment. (keeping the durable object binding intact per env)
I managed to do this by specifying the name of each environment in the toml file but when i publish it only seems to update the code for the main environment that is currently set to staging. (resulting in not being able to update production env, only environment vars)
Any ideas how i would overwrite the code for the production based on the --env environment, possibly by setting it up in the toml file ?
--------
Old situation with one worker with 2 environments (production,staging):
example-worker_staging
example_worker_production
New situation with two workers with 1 environment (production)
example-worker-staging
example-worker-production