{"version":3,"file":"check-install-path.mjs","sources":["../../src/utils/check-install-path.ts"],"sourcesContent":["import chalk from 'chalk';\nimport fse from 'fs-extra';\nimport stopProcess from './stop-process';\n\n// Checks if the an empty directory exists at rootPath\nexport default async (rootPath: string) => {\n  if (await fse.pathExists(rootPath)) {\n    const stat = await fse.stat(rootPath);\n\n    if (!stat.isDirectory()) {\n      stopProcess(\n        `⛔️ ${chalk.green(\n          rootPath\n        )} is not a directory. Make sure to create a Strapi application in an empty directory.`\n      );\n    }\n\n    const files = await fse.readdir(rootPath);\n    if (files.length > 1) {\n      stopProcess(\n        `⛔️ You can only create a Strapi app in an empty directory.\\nMake sure ${chalk.green(\n          rootPath\n        )} is empty.`\n      );\n    }\n  }\n};\n"],"names":[],"mappings":";;;AAKA,MAAe,mBAAA,OAAO,aAAqB;AACzC,MAAI,MAAM,IAAI,WAAW,QAAQ,GAAG;AAClC,UAAM,OAAO,MAAM,IAAI,KAAK,QAAQ;AAEhC,QAAA,CAAC,KAAK,eAAe;AACvB;AAAA,QACE,MAAM,MAAM;AAAA,UACV;AAAA,QACD,CAAA;AAAA,MAAA;AAAA,IAEL;AAEA,UAAM,QAAQ,MAAM,IAAI,QAAQ,QAAQ;AACpC,QAAA,MAAM,SAAS,GAAG;AACpB;AAAA,QACE;AAAA,YAAyE,MAAM;AAAA,UAC7E;AAAA,QACD,CAAA;AAAA,MAAA;AAAA,IAEL;AAAA,EACF;AACF;"}