import {
    NormalizedServerObject,
    ParsedDeploymentServiceConfig,
    TCIGlobalConfig,
} from "@/src/types/turboci";
import execSSH from "@/src/utils/exec-ssh";
import serviceFlight from "@/src/utils/flight";

type Params = {
    service: ParsedDeploymentServiceConfig;
    config: TCIGlobalConfig;
};

export default async function cronCheckServicesGit({
    config,
    service,
}: Params) {
    if (service.git) {
        const service_git_array = Array.isArray(service.git)
            ? service.git
            : [service.git];

        for (let i = 0; i < service_git_array.length; i++) {
            const service_git = service_git_array[i];

            if (!service_git.keep_updated) {
                continue;
            }

            const work_dir = service_git.work_dir || "/turboci/app";

            let cmd = ``;

            cmd += `set -e\n`;
            cmd += `\n`;
        }
    }
}
