#!/usr/bin/env node
import {
  resolveSource
} from "../chunk-GFDGYQ6M.js";
import "../chunk-T4EXUIBY.js";
import "../chunk-C4QI54PN.js";
import "../chunk-FTD5Z6QD.js";
import {
  init_esm_shims
} from "../chunk-DHET7RCE.js";

// src/cli/hooks/init.ts
init_esm_shims();
var hook = async function(options) {
  const projectDir = process.cwd();
  let sourceFlag;
  const sourceArgIndex = options.argv.indexOf("--source");
  if (sourceArgIndex !== -1 && sourceArgIndex + 1 < options.argv.length) {
    sourceFlag = options.argv[sourceArgIndex + 1];
  } else {
    const sourceFlagWithEquals = options.argv.find((arg) => arg.startsWith("--source="));
    if (sourceFlagWithEquals) {
      sourceFlag = sourceFlagWithEquals.split("=")[1];
    }
  }
  const sArgIndex = options.argv.indexOf("-s");
  if (sArgIndex !== -1 && sArgIndex + 1 < options.argv.length) {
    sourceFlag = options.argv[sArgIndex + 1];
  }
  try {
    const resolvedConfig = await resolveSource(sourceFlag, projectDir);
    options.config.sourceConfig = resolvedConfig;
  } catch (error) {
  }
};
var init_default = hook;
export {
  init_default as default
};
//# sourceMappingURL=init.js.map