Open atafs opened 8 years ago
i am having the same issue
Not sure if this is going to help anyone, but: I had the same error and it appears it is because the perl project folder I was using was not initialized as a git repository :). Per the atom-perl-prove docs "When activated, this package will check what the base directory for the git repository for the current file"
Basically it appears to look up some settings in the git repository files because it assumes you are using a git repo. IF this is the case then.....you need to add/convert your perl project to use git and be a git repository (you don't have to check it into github)
On the OS I have this installed: git <- I believe almost any version or package that's "git" for your OS will contain the "git" executable, which is what you need.
In Atom I have these packages installed and configured: git-plus <- I have multiple config changes in git and in the template, your mileage may vary. You don't need to as you can look up all the "git" commands to execute to perform the same steps, but the instructions below are what I did using this template
atom-perl-prove <- validate/configure the path to the "prove" executable for my system
Setup: In Atom, open the folder/project where your perl module/scripts are that contains the "t" directory (or whatever directory above where the perl tests are located, don't go into the test directory itself). Keep this project/folder selected/open in Atom for the steps below.
Execute a git 'init' to prep the folder/repo for git integration.
Use git to commit the new files.
Retry running tests using atom-perl-prove
UPDATE: I found this error started occurring again. Looking at the error: "TypeError: Cannot read property 'getPath' ...." and the atom-perl-prove.coffee file, on line 66: base_path = this.execSync("/usr/bin/git", new Directory(atom.workspace.getActiveTextEditor().getPath()).getParent().getPath(), "", ["rev-parse", "--show-toplevel"]).stdout.trim()
It appears the issue is with the "atom.workspace.getActiveTextEditor...." part. When I got the error I didn't have any of the project/repository files open in the editor (so there are no active TextEditors in my workspace). I opened a top-level file in my workspace and re-ran "Atom Perl Prove: Run tests" and now it works. So have a file open from the project as well.
No thanks. I don't want to have to use git to use prove.
[Enter steps to reproduce below:]
Atom Version: 1.11.2 Electron Version: 0.37.8 System: Mac OS X 10.12 Thrown From: atom-perl-prove package, v0.6.0
Stack Trace
Uncaught TypeError: Cannot read property 'getPath' of undefined
Commands
Config
Installed Packages