package p.packer.messages;

import java.nio.file.Path;
import java.util.Objects;

public record PackerProjectContext(
        String projectId,
        Path rootPath) {

    public PackerProjectContext {
        projectId = Objects.requireNonNull(projectId, "projectId").trim();
        rootPath = Objects.requireNonNull(rootPath, "rootPath").toAbsolutePath().normalize();
        if (projectId.isBlank()) {
            throw new IllegalArgumentException("projectId must not be blank");
        }
    }
}
