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

Tell about possibly missing dvm install #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion dvm/commands/Install.d
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,19 @@ private:
wrapper.path ~= ".bat";

verbose("Installing wrapper: " ~ wrapper.path);
wrapper.write;
try
{
wrapper.write;
}
catch (Exception ex)
{
import std.regex;
if (matchFirst(ex.toString(), r"dmd-[\d\.]+\.bat"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like using the textual representation of an exception to identify what kind of exception it is. Please either catch the specific exception type or make an explicit check that the necessary file/directory structure is available.

Perhaps it's worth adding a more general check which is executed for all commands?

{
println("Error installing - did you remember to 'dvm install dvm' first?");
}
throw ex;
}
}

void setPermissions ()
Expand Down