atom / package-generator

Package to generate new packages
MIT License
92 stars 46 forks source link

Package generator uses invalid path #27

Closed ghost closed 9 years ago

ghost commented 9 years ago

The package generator appends /my-project to the projects home to generate the default package location, but then appends the path again when actually creating the package.

Creating the package atom-bug-1 Noticing the bug atom-bug-2

ghost commented 9 years ago

Steps to reproduce

  1. Open Atom 1.0.0.
  2. Use the command palate or Packages menu (both cause the bug) to execute Package Generator: Generate Atom Package.
  3. Replace the highlighted text with desired project name.
  4. Check path in status bar.

Expected result

Package generator would produce a new directory with the proper structure in <canonical-projects-home-path>/<package-name> and open it as a project in a new Atom window.

Actual result

Package generator created no directory and opened a new empty file at the supposed path <canonical-projects-home-path>/<package-name>/<raw-projects-home-path>/<package-name> in a new Atom window.

zeptonaut commented 9 years ago

I'm able to repro this locally using the above steps (on Ubuntu 14.04).

This seems like a really major bug, given that Atom just went live and the package generator is used by just about all of the "create your own package" tutorials. This is going to be a major sticking point for new Atom users interested in playing around with creating their own packages.

thomasjo commented 9 years ago

~ is a Bash expansion, not an OS-level expansion as many users seem to think. The correct path in the original issue should be /Users/alex/Documents/Git/my-package.

I guess we should either correct the issue by "resolving" the tilde expansion, or validate entered paths and in this case, reject it.

mnquintana commented 9 years ago

IMO we should expand ~ – I don't think we should put the onus on users to manually "expand" that ~ themselves when they want to use their home directory.

zeptonaut commented 9 years ago

I don't think this problem is dependent on there being a tilde in the path: I encountered this problem when I tried to create a package at /tmp/my-package yesterday.

thomasjo commented 9 years ago

I don't think this problem is dependent on there being a tilde in the path: I encountered this problem when I tried to create a package at /tmp/my-package yesterday.

@zeptonaut I'm unable to reproduce. Are you sure you didn't mistype something? I just successfully created packages in both my user folder, and /tmp.

izuzak commented 9 years ago

Yeah, I'm unable to reproduce this as well for a full path. I can reproduce the problem if the path contains a ~, though.