import { printResultToConsoleAndExitGracefully } from "../common/output.js";
import { pullLocalConfig } from "../common/populate.js";
export async function link(argv) {
    const account = argv.account;
    const project = argv.project;
    const environment = argv.environment;
    if (!account || !project || !environment) {
        throw new Error("Invalid state: account, project, or environment is not set.");
    }
    await pullLocalConfig(argv);
    await printResultToConsoleAndExitGracefully(`
Successfully linked your local directory to the ${project} project in the ${account} account.
.env.zuplo and zuplo.jsonc have been updated with the new values.`);
}
//# sourceMappingURL=handler.js.map