sqitch icon indicating copy to clipboard operation
sqitch copied to clipboard

sqitch init called on already initialized directory silenlty fails

Open strk opened this issue 5 years ago • 3 comments

See this session:

$ sqitch init tutorial --engine mysql && grep 'engine =' sqitch.conf
Created sqitch.conf
        engine = mysql
$ sqitch init tutorial --engine pg && grep 'engine =' sqitch.conf
        engine = mysql

I would expect the second run to fail instead.

Note that changing the name does indeed fail:

$ sqitch init test --engine pg && grep 'engine =' sqitch.conf
Cannot initialize because project "tutorial" already initialized in sqitch.plan

strk avatar Mar 24 '20 11:03 strk

The above happens with sqitch (App::Sqitch) 0.9996

strk avatar Mar 24 '20 11:03 strk

Yeah, it sees that the file exists already so don't create it. Could read it in and see if there are any disagreements, but it's quite easily fixed by running sqitch config core.engine pg.

theory avatar Mar 24 '20 13:03 theory

Even NOT checking would be ok, just fail mentioning the directory is already initialized and maybe HINT about using sqitch config

strk avatar Mar 24 '20 14:03 strk