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

ghost picture ghost  路  3Comments

brendonmm picture brendonmm  路  4Comments

ankushdas9 picture ankushdas9  路  3Comments

theman1616 picture theman1616  路  4Comments

TheHedge picture TheHedge  路  3Comments