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

Feature: submodule: validate repository / init/update submodule #3

Open
DarkTrick opened this issue Jul 25, 2023 · 0 comments
Open

Comments

@DarkTrick
Copy link
Owner

Command for validating repository

This should show if the repo is complete as it is or if it needs further init commands; and which commands it needs (e.g. for submodules)

Command for init/update submodules

Command should init submodules or update submodules (whichever is necessary)

Reference: check if a submodule needs update

git submodule status --recursive | grep -q '^[-+U]'
if [ $? -eq 0 ]; then
    echo "Some submodules need to be initialized. Run 'git submodule update --init'."
else
    echo "All submodules are up to date. No need to run 'git submodule update --init'."
fi

Note: git "--recursive" should be triggered with "--all"

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