Brackets: ProjectManager.createNewItem ignores isFolder argument if skipRename is true

Created on 5 Apr 2017  路  2Comments  路  Source: adobe/brackets

Description

ProjectManager.createNewItem('/path', 'name', false, true) successfully creates a directory without skipping renaming.

ProjectManager.createNewItem('/path', 'name', true, true) will skip renaming, but creates a file even though isFolder is true.

Steps to Reproduce

Expected behavior: A folder is created when isFolder is true, regardless of skipRename.

Actual behavior: Only files are created when skipRename is true.

Versions

OSX 10.11.6
Brackets 1.9 build 1.9.0-17312 (release 189f6d39a)

F Project Management

Most helpful comment

createNewItem is passing the isFolder argument:

return model.createAtPath(baseDir + initialName, isFolder);

But the definition of this method on the model has no such argument, so it's being ignored.

ProjectModel.prototype.createAtPath = function (path) {
    var isFolder  = !_pathIsFile(path)

Should be as simple as adding the argument. Will be making a PR soon.

All 2 comments

createNewItem is passing the isFolder argument:

return model.createAtPath(baseDir + initialName, isFolder);

But the definition of this method on the model has no such argument, so it's being ignored.

ProjectModel.prototype.createAtPath = function (path) {
    var isFolder  = !_pathIsFile(path)

Should be as simple as adding the argument. Will be making a PR soon.

@RationalCoding sounds good to me.

You supply the PR and we will review.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Qussayyon picture Qussayyon  路  69Comments

lelolee picture lelolee  路  70Comments

patnealcodes picture patnealcodes  路  55Comments

paulbonneau picture paulbonneau  路  77Comments

weblogixx picture weblogixx  路  45Comments