File tree Expand file tree Collapse file tree
source/CommandLine/ShellCompletion Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22using System . IO ;
33using System . Linq ;
44using System . Text ;
5+ using Octopus . CommandLine . Commands ;
56using Octopus . CommandLine . Extensions ;
67using Octopus . CommandLine . Plumbing ;
78
@@ -49,6 +50,13 @@ public virtual void Install(bool dryRun)
4950 {
5051 if ( profileText . Contains ( AllShellsPrefix ) || profileText . Contains ( AllShellsSuffix ) || profileText . Contains ( ProfileScript ) )
5152 {
53+ if ( ! profileText . Contains ( ProfileScript ) ) {
54+ var message =
55+ $ "Looks like command line completion is already installed, but points to a different executable.{ Environment . NewLine } " +
56+ $ "Please manually edit the file { ProfileLocation } to remove the existing auto complete script and then re-install.";
57+ throw new CommandException ( message ) ;
58+ }
59+
5260 commandOutputProvider . Information ( "Looks like command line completion is already installed. Nothing to do." ) ;
5361 return ;
5462 }
@@ -84,4 +92,4 @@ public virtual void Install(bool dryRun)
8492 }
8593 }
8694 }
87- }
95+ }
You can’t perform that action at this time.
0 commit comments