def do_command(self): cwfile_dir = CWFILES_DIR_PATH ebextension_dir = fileoperations.project_file_path('.ebextensions') if self.app.pargs.remove: return remove_cwl_extensions(cwfile_dir, ebextension_dir) if not os.path.isdir(ebextension_dir): os.makedirs(ebextension_dir) for file_name in os.listdir(cwfile_dir): source_file = os.path.join(cwfile_dir, file_name) destination = os.path.join(ebextension_dir, file_name) if fileoperations.file_exists(destination): io.log_error(strings['cloudwatch-setup.alreadysetup'] .format(filename=destination)) shutil.copy(source_file, destination) io.echo(strings['cloudwatch-setup.text'])
def dockerrun_path(cls): return fileoperations.project_file_path(cls.DOCKERRUN_FILENAME)
def dockerignore_path(cls): return fileoperations.project_file_path(cls.DOCKERIGNORE_FILENAME)
def test_project_file_path(self, get_project_root): get_project_root.side_effect = [os.path.sep] expected_file_path = '{}foo'.format(os.path.sep) self.assertEqual(fileoperations.project_file_path('foo'), expected_file_path)