We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e14e1d4 commit ec2ce64Copy full SHA for ec2ce64
lib/cli.js
@@ -23,6 +23,20 @@ module.exports = async (argvs) => {
23
const timer = elapsed.start();
24
const version = argv["release"] || "latest";
25
const targetDir = path.resolve(argv["_"][0] || "./");
26
+ const folderFiles = await fs.readdir(targetDir);
27
+ if (folderFiles.length !== -1) {
28
+ const { override } = await prompts({
29
+ type: "confirm",
30
+ name: "override",
31
+ message: `${targetDir} is not empty folder, proceed?`,
32
+ initial: true,
33
+ });
34
+
35
+ if (!override) {
36
+ console.log(chalk.red("Aborted"));
37
+ return;
38
+ }
39
40
spinner = ora(
41
`Downloading ${packageName} version '${version}' to ${targetDir}`
42
).start();
0 commit comments