async function cmdScan(path: string): Promise<void> {
const expandedPath = path.startsWith("~")
? path.replace("~", process.env.HOME || "")
: path
console.log(`Scanning ${expandedPath}...`)
const result = await scanProjects({
input: { path: expandedPath }
})
.then(res => {
console.log("Raw scan result:", res)
return res
})
.catch(err => {
// ⚠️ We never even get here. It just dies ⚠️
console.error("Error during scan:", err.message)
process.exit(1)
})
if (result.success) {
const projects = result.data
console.log(`Found ${projects.length} projects:`)
for (const p of projects) {
const statusIcon = p.status === "ok" ? "✓" : "✗"
console.log(` ${statusIcon} ${p.name} [${p.type}]`)
}
} else {
console.error("Failed to scan:", result.errors?.[0]?.message)
process.exit(1)
}
}
async function cmdScan(path: string): Promise<void> {
const expandedPath = path.startsWith("~")
? path.replace("~", process.env.HOME || "")
: path
console.log(`Scanning ${expandedPath}...`)
const result = await scanProjects({
input: { path: expandedPath }
})
.then(res => {
console.log("Raw scan result:", res)
return res
})
.catch(err => {
// ⚠️ We never even get here. It just dies ⚠️
console.error("Error during scan:", err.message)
process.exit(1)
})
if (result.success) {
const projects = result.data
console.log(`Found ${projects.length} projects:`)
for (const p of projects) {
const statusIcon = p.status === "ok" ? "✓" : "✗"
console.log(` ${statusIcon} ${p.name} [${p.type}]`)
}
} else {
console.error("Failed to scan:", result.errors?.[0]?.message)
process.exit(1)
}
}