|
1 | 1 | using CommandLine; |
2 | | -using GVFS.Common; |
3 | | -using GVFS.Common.FileSystem; |
4 | | -using GVFS.Common.Tracing; |
5 | 2 | using System; |
6 | | -using System.Diagnostics; |
7 | | -using System.IO; |
8 | 3 |
|
9 | 4 | namespace GVFS.CommandLine |
10 | 5 | { |
11 | 6 | [Verb(UpgradeVerbName, HelpText = "Checks for new GVFS release, downloads and installs it when available.")] |
12 | 7 | public class UpgradeVerb : GVFSVerb.ForNoEnlistment |
13 | 8 | { |
14 | 9 | private const string UpgradeVerbName = "upgrade"; |
15 | | - private const string DryRunOption = "--dry-run"; |
16 | | - private const string NoVerifyOption = "--no-verify"; |
17 | | - private const string ConfirmOption = "--confirm"; |
18 | | - |
19 | | - private ITracer tracer; |
20 | | - private PhysicalFileSystem fileSystem; |
21 | | - private ProcessLauncher processLauncher; |
22 | | - |
23 | | - public UpgradeVerb( |
24 | | - ITracer tracer, |
25 | | - PhysicalFileSystem fileSystem, |
26 | | - ProcessLauncher processWrapper, |
27 | | - TextWriter output) |
28 | | - { |
29 | | - this.tracer = tracer; |
30 | | - this.fileSystem = fileSystem; |
31 | | - this.processLauncher = processWrapper; |
32 | | - this.Output = output; |
33 | | - } |
34 | 10 |
|
35 | 11 | public UpgradeVerb() |
36 | 12 | { |
37 | | - this.fileSystem = new PhysicalFileSystem(); |
38 | | - this.processLauncher = new ProcessLauncher(); |
39 | 13 | this.Output = Console.Out; |
40 | 14 | } |
41 | 15 |
|
@@ -67,56 +41,7 @@ protected override string VerbName |
67 | 41 |
|
68 | 42 | public override void Execute() |
69 | 43 | { |
70 | | - this.ReportErrorAndExit(this.tracer, ReturnCode.GenericError, "failed to upgrade"); |
71 | | - } |
72 | | - |
73 | | - public class ProcessLauncher |
74 | | - { |
75 | | - public ProcessLauncher() |
76 | | - { |
77 | | - this.Process = new Process(); |
78 | | - } |
79 | | - |
80 | | - public Process Process { get; private set; } |
81 | | - |
82 | | - public virtual bool HasExited |
83 | | - { |
84 | | - get { return this.Process.HasExited; } |
85 | | - } |
86 | | - |
87 | | - public virtual int ExitCode |
88 | | - { |
89 | | - get { return this.Process.ExitCode; } |
90 | | - } |
91 | | - |
92 | | - public virtual void WaitForExit() |
93 | | - { |
94 | | - this.Process.WaitForExit(); |
95 | | - } |
96 | | - |
97 | | - public virtual bool TryStart(string path, string args, bool useShellExecute, out Exception exception) |
98 | | - { |
99 | | - this.Process.StartInfo = new ProcessStartInfo(path) |
100 | | - { |
101 | | - UseShellExecute = useShellExecute, |
102 | | - WorkingDirectory = Environment.SystemDirectory, |
103 | | - WindowStyle = ProcessWindowStyle.Normal, |
104 | | - Arguments = args |
105 | | - }; |
106 | | - |
107 | | - exception = null; |
108 | | - |
109 | | - try |
110 | | - { |
111 | | - return this.Process.Start(); |
112 | | - } |
113 | | - catch (Exception ex) |
114 | | - { |
115 | | - exception = ex; |
116 | | - } |
117 | | - |
118 | | - return false; |
119 | | - } |
| 44 | + Console.Error.WriteLine("'gvfs upgrade' is no longer supported. Visit https://github.com/microsoft/vfsforgit for the latest install/upgrade instructions."); |
120 | 45 | } |
121 | 46 | } |
122 | 47 | } |
0 commit comments