Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't error on not managed projects #55

Closed
PhiLhoSoft opened this issue Jan 7, 2016 · 10 comments
Closed

Don't error on not managed projects #55

PhiLhoSoft opened this issue Jan 7, 2016 · 10 comments

Comments

@PhiLhoSoft
Copy link

It is kind of related to #15. When I open a project that's not managed by Perforce, I see errors in the console. It is a minor issue, but I think it would be better if the package just shut off and disable itself on such project.
The error:
atom-atom-perforce-notmanaged
In short, in textual form:

Error: Command failed: C:\Windows\system32\cmd.exe /s /c "p4 -ztag opened ./..."
Path 'c:\SomePath\PhiLhoSoft\Web\Playground...' is not under client's root 'C:/Sources'.

where C:/Sources is the value of P4ROOT.

At home, where I don't have Perforce at all (but the package is installed because I have synchronized my settings), I have another error.
Perhaps you can detect if there is a P4ROOT environment variable. If not, just disable the package. If so, check the value against the Project paths. If not matching, don't try to issue p4 commands there.

Note: I appreciate the package, far more complete than the primitive (but already useful) one in Brackets, even providing useful information to the tree-view (status modified / added, etc.). Thanks.

@unional
Copy link
Collaborator

unional commented Jan 7, 2016

That seems like a regression. I had a PR to fix that. Let me check

@unional unional closed this as completed in 346e071 Jan 8, 2016
@unional
Copy link
Collaborator

unional commented Jan 8, 2016

@mattsawyer77 , how do you update the CHANGELOG? Are you doing it manually?

@mattsawyer77
Copy link
Owner

@unional I use this tool: https://github.com/skywinder/github-changelog-generator

Basically I do the following:

github_changelog_generator -t <your token goes here> -u <your username> -p atom-perforce

then I edit CHANGELOG.md, replacing the unknown version #s with the next version (apm patch increments the 3rd digit, apm minor increments the 2nd digit, and apm publish major increments the first digit. then I make that commit)

then

git push origin master
api publish patch

hope that helps.

@unional
Copy link
Collaborator

unional commented Jan 8, 2016

Done! 🌹

@unional
Copy link
Collaborator

unional commented Jan 8, 2016

@PhiLhoSoft , does the new version solve your problem?

@PhiLhoSoft
Copy link
Author

Sorry for the delay, I waited to be able to test at home.
At work, the fix is effective, I no longer have an error when I have multiple projects (one under Perforce, the other not) opened.
At home (Windows 10), I still have errors, alas.
atom-atom-perforce-noperforce

Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "p4 info "(…)
Unhandled promise rejection Object with error: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "p4 info "(…)

As said, p4 isn't installed at home, no P4 in environment, etc.

// call p4 info to make sure perforce is available

Well, might I suggest that if there is no P4ROOT environment variable, this test can be skipped entirely? My goal is to avoid, if possible, to have red lines in my console... 😄

@unional
Copy link
Collaborator

unional commented Jan 10, 2016

You are right. I forgot to consider that. :P

@unional unional reopened this Jan 10, 2016
@unional
Copy link
Collaborator

unional commented Jan 10, 2016

@PhiLhoSoft , like you said, it is related to #15 and I think that's the best way to fix this issue.
@mattsawyer77 , what do you think? I don't want to make any big changes without your input. 🌹

@mattsawyer77
Copy link
Owner

If someone wants to implement #15 that would be cool. I'd like the see the PR for it before it's merged though.

@unional
Copy link
Collaborator

unional commented Jan 12, 2016

Close this for #58 "Don't error on not managed projects" is fixed.

@unional unional closed this as completed Jan 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants