How to compile with different settings without risk of messing up?

I want my source be compiled with different settings: for local deployment and for mainnet deployment. How to make options different?

I can create a Makefile that would write different values to a Motoko source file, but I am afraid that I by instinct will type dfx deploy --ic and this would upload my locally stored keys to the public network.

So, how?

Oh, I know:

I can create a script or a Makefile that will create symlinks to a config, compile or deploy, and then remove the symlinks (by trapping EXIT message in Bash, to be sure that the symlinks be deleted, even if the user pressed Ctrl+C in the middle).

1 Like