Revision a8a770cc120ca0783a4751754f33c7982557a97e authored by Mark Karpov on 30 March 2020, 16:59:31 UTC, committed by Benjamin Canou on 14 April 2020, 16:59:54 UTC
There were two layers of identical checks: one in
create_mockup_command_handler and another one in create_mockup itself. I
combined the checks so that they are now only in create_mockup.

The function classify_base_dir contains all the logic for analysis of the
state of base_dir, so I re-used it in create_mockup. Now we do create
base_dir if it is missing but only when it did not exist or was empty. These
conditions should be enough to prevent it from overwriting existing data. In
addition to that we indicate the fact that a new directory was created by
printing a message.

I also made classify_base_dir more precise: it now recognizes another
pathological case when base_dir is a file. It looks like the old
implementation was buggy: when given a file it would declare that the
directory does not exist.

I also renamed mockup_mode into client_mode, because it includes
Mode_client, which has nothing to do with mockup.
1 parent 0cd130a
History
File Mode Size
.github
.gitlab
docs
emacs
scripts
src
tests_python
vendors
.dockerignore -rw-r--r-- 651 bytes
.gitattributes -rw-r--r-- 132 bytes
.gitignore -rw-r--r-- 889 bytes
.gitlab-ci.yml -rw-r--r-- 27.9 KB
Dockerfile -rw-r--r-- 3.9 KB
LICENSE -rw-r--r-- 1.3 KB
Makefile -rw-r--r-- 9.4 KB
README.md -rw-r--r-- 2.5 KB
active_protocol_versions -rw-r--r-- 19 bytes
build.Dockerfile -rw-r--r-- 588 bytes
contributing.md -rw-r--r-- 2.3 KB
dune -rw-r--r-- 110 bytes
dune-project -rw-r--r-- 243 bytes
dune-workspace -rw-r--r-- 16 bytes

README.md

back to top