has-diff.sh 345 B

123456789101112131415
  1. #!/bin/bash
  2. # Copyright 2019-2024 Tauri Programme within The Commons Conservancy
  3. # SPDX-License-Identifier: Apache-2.0
  4. # SPDX-License-Identifier: MIT
  5. git_output=$(git diff --ignore-submodules --name-only HEAD)
  6. if [ -z "$git_output" ];
  7. then
  8. echo "✔ working directory is clean"
  9. else
  10. echo "✘ found diff:"
  11. echo "$git_output"
  12. exit 1
  13. fi