From 28fe1007ec641213a308b5af7b9e66016aa1d283 Mon Sep 17 00:00:00 2001 From: Jonas Drewsen Date: Fri, 13 Nov 2015 08:05:08 +0100 Subject: [PATCH 1/2] Tell about possibly missing dvm install when wrapper for dmd throws an exception --- dvm/commands/Install.d | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dvm/commands/Install.d b/dvm/commands/Install.d index 1ecad83..3a65046 100644 --- a/dvm/commands/Install.d +++ b/dvm/commands/Install.d @@ -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")) + { + println("Error installing - did you remember to 'dvm install dvm' first?"); + } + throw ex; + } } void setPermissions () From 5a94bd6f0319df8d98c27fbeb464e2560ef39a95 Mon Sep 17 00:00:00 2001 From: Jonas Drewsen Date: Fri, 13 Nov 2015 08:08:24 +0100 Subject: [PATCH 2/2] Match more that one digit --- dvm/commands/Install.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dvm/commands/Install.d b/dvm/commands/Install.d index 3a65046..a5f52c9 100644 --- a/dvm/commands/Install.d +++ b/dvm/commands/Install.d @@ -144,7 +144,7 @@ private: catch (Exception ex) { import std.regex; - if (matchFirst(ex.toString(), r"dmd-[\d\.]\.bat")) + if (matchFirst(ex.toString(), r"dmd-[\d\.]+\.bat")) { println("Error installing - did you remember to 'dvm install dvm' first?"); }