depthcharge-helper 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env bash
  2. # Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
  3. # Copyright (C) 2018 Andrew Robbins <contact@andrewrobbins.info>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ARCH="arch"
  18. depthcharge_arch() {
  19. project_file_contents "$project" "$CONFIGS" "$ARCH" "$@"
  20. }
  21. depthcharge_device() {
  22. arguments_concat "_" "$@"
  23. }
  24. depthcharge_libpayload_build_path() {
  25. local project='libpayload'
  26. local build_path="$root/$BUILD/$project"
  27. local argument
  28. for argument in "$@"; do
  29. build_path="$build_path-$argument"
  30. if [[ -d $build_path ]]; then
  31. break
  32. else
  33. continue
  34. fi
  35. done
  36. printf '%s\n' "$build_path"
  37. }