Skip to content

Commit

Permalink
Fix completions when install by cs - strip suffix .aux (#1561)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwronski authored Nov 10, 2022
1 parent bf5ebc2 commit 6e9117c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ object InstallCompletions extends ScalaCommand[InstallCompletionsOptions] {
name.getOrElse {
val baseName = (new Argv0).get(baseRunnerName)
val idx = baseName.lastIndexOf(File.separator)
if (idx < 0) baseName
else baseName.drop(idx + 1)
val last = if (idx < 0) baseName else baseName.drop(idx + 1)
last match {
case s".${name}.aux" => name // // cs install binaries under .app-name.aux
case name => name
}
}

def getFormat(format: Option[String]): Option[String] =
Expand Down

0 comments on commit 6e9117c

Please sign in to comment.