Skip to content

Commit

Permalink
Remove trailing slashes when validating gitops repo working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dbackeus committed Jun 17, 2024
1 parent 81e651c commit 369d743
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions k
Original file line number Diff line number Diff line change
Expand Up @@ -2212,8 +2212,8 @@ end
PRIVATE_METHODS_AFTER_COMMANDS = private_methods - PRIVATE_METHODS_BEFORE_COMMANDS

def verify_inside_context_repository!
context_repo = URI K_CONTEXT.fetch("repository").delete_suffix(".git")
current_repo = URI `git remote get-url origin`.strip.delete_suffix(".git")
context_repo = URI K_CONTEXT.fetch("repository").delete_suffix(".git").delete_suffix("/")
current_repo = URI `git remote get-url origin`.strip.delete_suffix(".git").delete_suffix("/")

unless context_repo.path == current_repo.path
abort "Error: this command must be run from a clone of the context repository (#{context_repo})"
Expand Down

0 comments on commit 369d743

Please sign in to comment.