Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to check gitsubmodules #45

Closed
rramsden opened this issue Mar 26, 2020 · 0 comments
Closed

Ability to check gitsubmodules #45

rramsden opened this issue Mar 26, 2020 · 0 comments

Comments

@rramsden
Copy link
Member

Context

There's quite a bit of duplication across some of our Kaiser projects which check that submodules exist. For example, HATS and HCS both define the following in their kaiser files:

`git submodule status`.lines.each do |line|
  # The git-submodule man page says uninitialized submodules are prefixed with a -
  # but I found this unreliable. While testing I pressed Control-C in the middle of
  # the update command so some submodule would be initialized and others wouldn't.
  # After that, the status command had removed the - for every submodule.
  # Therefore we just check if there's files in the directory instead.
  dir = line.strip.split(' ')[1]
  if Dir.empty?(dir)
    puts "Found uninitialized git submodule '#{dir}'"
    puts "please run 'git submodule update --init --recursive'"
    exit 1
  end
end

Of course this would tie Kaiser to git but that's maybe not a bad thing. If there is a use-case without git than maybe this could be implemented as a helper method e.g. check_git_submodules!

@rramsden rramsden changed the title Ability to get gitsubmodules Ability to check gitsubmodules Mar 26, 2020
@rramsden rramsden closed this as completed Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant