def stack_create(domain, name, meta_path=None, from_stack=None): """ Create a new stack. From old one if specified. """ # get the meta_path from .gachetterc meta_path = meta_path if 'meta_path' not in env else env.meta_path if not meta_path: abort("Please specify a `meta_path` or use a config file to define it") new_stack = Stack(domain, name, meta_path=meta_path) if not new_stack.is_persisted(): if from_stack: old_stack = Stack(domain, from_stack, meta_path=meta_path) new_stack.clone_from(old_stack) else: new_stack.persist()