class CreateGithubRelease::Assertions::InRepoRootDirectory
@api public
Checks both the local repository and the remote repository.
Assert that the current directory is the root of the repository
def assert
-
(SystemExit)
- if the assertion fails
Returns:
-
(void)
-
def assert print "Checking that you are in the repo's root directory..." toplevel_directory = `git rev-parse --show-toplevel`.chomp error "git rev-parse failed: #{$CHILD_STATUS.exitstatus}" unless $CHILD_STATUS.success? if toplevel_directory == FileUtils.pwd puts 'OK' else error "You are not in the repo's root directory" end end