LayaAir icon indicating copy to clipboard operation
LayaAir copied to clipboard

在编辑器下将scene文件移到这个文件当前的目录会导致文件被删除

Open imfox opened this issue 5 years ago • 3 comments

是不是只是简单的执行了一下mv然后rm 因为路径相同导致后面rm掉了?

imfox avatar Oct 15 '19 08:10 imfox

我不明白你说的什么意思?能重新表述以下吗?

KylinLove avatar Oct 17 '19 07:10 KylinLove

~ rt

imfox avatar Oct 17 '19 08:10 imfox

layabuilder.max.js 的15484FileTools.rename方法 中判断isPathSame逻辑有问题

FileTools.isPathSame=function(a,b){
			if(a.toLocaleLowerCase()==b.toLocaleLowerCase())return true;
			return false;
		}

没有将\/视为相同路径 最好是改成

FileTools.isPathSame=function(a,b){
			const path = require("path");
			var a=path.normalize(a);
			var b=path.normalize(b);
			if(a.toLocaleLowerCase()==b.toLocaleLowerCase())return true;
			return false;
		}

而且路径做 toLocaleLowerCase 处理是否合适?虽然windows不区分大小写

eos3tion avatar Oct 17 '19 12:10 eos3tion