mirror of
https://github.com/adobe/brackets.git
synced 2024-11-20 09:53:00 +01:00
Correcting file name if file path ends with forward slash (#14323)
This commit is contained in:
parent
c4d4684bfe
commit
ca5d2ae060
@ -45,6 +45,17 @@ define(function (require, exports, module) {
|
||||
});
|
||||
}
|
||||
|
||||
function _getFileName(filePath) {
|
||||
var fileName = filePath.split('/').pop();
|
||||
|
||||
if (!fileName.trim()) {
|
||||
fileName = filePath.trim().slice(0, -1);
|
||||
fileName = fileName.split('/').pop();
|
||||
}
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Model for a RemoteFile.
|
||||
*
|
||||
@ -62,7 +73,7 @@ define(function (require, exports, module) {
|
||||
this._path = fullPath;
|
||||
this._stat = _getStats(fullPath);
|
||||
this._id = fullPath;
|
||||
this._name = fullPath.split('/').pop();
|
||||
this._name = _getFileName(fullPath);
|
||||
this._fileSystem = fileSystem;
|
||||
this.donotWatch = true;
|
||||
this.protocol = protocol;
|
||||
|
Loading…
Reference in New Issue
Block a user