diff --git a/src/packages/package-generator/lib/package-generator-view.coffee b/src/packages/package-generator/lib/package-generator-view.coffee index cfec1464b..8ee7b83fc 100644 --- a/src/packages/package-generator/lib/package-generator-view.coffee +++ b/src/packages/package-generator/lib/package-generator-view.coffee @@ -60,18 +60,18 @@ class PackageGeneratorView extends View templatePath = fsUtils.resolveOnLoadPath(path.join("package-generator", "template")) packageName = path.basename(@getPackagePath()) - for path in fsUtils.listTree(templatePath) - relativePath = path.replace(templatePath, "") + for templateChildPath in fsUtils.listTree(templatePath) + relativePath = templateChildPath.replace(templatePath, "") relativePath = relativePath.replace(/^\//, '') relativePath = relativePath.replace(/\.template$/, '') relativePath = @replacePackageNamePlaceholders(relativePath, packageName) sourcePath = path.join(@getPackagePath(), relativePath) - if fsUtils.isDirectory(path) + if fsUtils.isDirectory(templateChildPath) fsUtils.makeTree(sourcePath) - if fsUtils.isFile(path) + if fsUtils.isFile(templateChildPath) fsUtils.makeTree(path.dirname(sourcePath)) - content = @replacePackageNamePlaceholders(fsUtils.read(path), packageName) + content = @replacePackageNamePlaceholders(fsUtils.read(templateChildPath), packageName) fsUtils.write(sourcePath, content) replacePackageNamePlaceholders: (string, packageName) -> diff --git a/src/packages/tree-view/lib/tree-view.coffee b/src/packages/tree-view/lib/tree-view.coffee index 250c32372..e827860e6 100644 --- a/src/packages/tree-view/lib/tree-view.coffee +++ b/src/packages/tree-view/lib/tree-view.coffee @@ -274,19 +274,19 @@ class TreeView extends ScrollView onConfirm: (relativePath) => endsWithDirectorySeparator = /\/$/.test(relativePath) - path = project.resolve(relativePath) + pathToCreate = project.resolve(relativePath) try - if fsUtils.exists(path) - pathType = if fsUtils.isFile(path) then "file" else "directory" + if fsUtils.exists(pathToCreate) + pathType = if fsUtils.isFile(pathToCreate) then "file" else "directory" dialog.showError("Error: A #{pathType} already exists at path '#{path}'. Try a different path.") else if endsWithDirectorySeparator - fsUtils.makeTree(path) + fsUtils.makeTree(pathToCreate) dialog.cancel() - @entryForPath(path).buildEntries() - @selectEntryForPath(path) + @entryForPath(pathToCreate).buildEntries() + @selectEntryForPath(pathToCreate) else - fsUtils.write(path, "") - rootView.open(path) + fsUtils.write(pathToCreate, "") + rootView.open(pathToCreate) dialog.close() catch e dialog.showError("Error: #{e.message} Try a different path.")