Example #1
0
def read_project(path: str, url=None) -> ConfigFile:
    files = get_files(path)
    if 'enot_config.json' in files:
        return EnotConfig.from_path(path, url=url)
    elif 'erlang.mk' in files:
        return ErlangMkConfig(path, url=url)
    elif 'rebar.config' in files:
        return RebarConfig(path, url=url)
    raise ValueError("Unknown build system in project " + path)
Example #2
0
 def test_create(self):
     enot.__main__.create(self.test_dir, {'<name>': 'test_project'})
     project_dir = join(self.test_dir, 'test_project')
     src_dir = join(project_dir, 'src')
     self.assertEqual(
         True, os.path.exists(project_dir))  # project dir was created
     self.assertEqual(True, os.path.exists(src_dir))  # src dir was created
     config = EnotConfig.from_path(project_dir)
     self.assertEqual({}, config.deps)  # no deps
     self.assertEqual('test_project',
                      config.name)  # name was set and parsed properly
     self.assertEqual(
         '0.0.1', config.conf_vsn)  # version was set and parsed properly