xmake-io / xmake-vscode

🍩 A XMake integration in Visual Studio Code
https://xmake.io
Apache License 2.0
227 stars 54 forks source link

`project directory (/path/dir) is not empty!` error when using VSCode and auto generated `.vscode` directory. #250

Closed traversebitree closed 8 months ago

traversebitree commented 8 months ago

Xmake Version

2.8.6

Operating System Version and Architecture

Windows 11

Describe Bug

I've been using CMake before and just tried using xmake today.

When a .vscode directory already exists in the directory (it is created automatically when you open the directory with vscode), using xmake create will prompt project directory (/path/dir) is not empty! error.

当目录下已经有.vscode目录存在(使用vscode打开目录后会自动创建),使用xmake create会提示目录非空。

Expected Behavior

There's no need for the directory to be empty, and directories or files such as .vscode, .idea, .gitignore, etc. already in the directory shouldn't give an error.

没必要目录是空的时候才能xmake create,目录中已经存在.vscode.idea.gitignore等目录或文件也不应该报错。

Project Configuration

Not yet...

Additional Information and Error Logs

Executing task: xmake create -t console -l c++ -P "d:\Workspace\CPP\xmake\xmake-test01" 

create xmake-test01 ...
error: project directory (d:\Workspace\CPP\xmake\xmake-test01) is not empty!

 *  The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command xmake create -t console -l c++ -P "d:\Workspace\CPP\xmake\xmake-test01"" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 
waruqi commented 8 months ago

主要是为了避免覆盖里面的同名文件,另外调用的 xmake create 是 xmake cli 内置的命令,不会去考虑硬编码处理 vscode 的东西。。

你直接删了 .vscode 创建下就行了,我这边测试没这个问题

image
traversebitree commented 8 months ago

@waruqi 好的,谢谢!