logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

install.t (1164B)


  1. #!/usr/bin/env cram
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. $ export PATH="$TESTDIR/../cmd:$PATH"
  5. $ test "$(command -v install)" = "$TESTDIR/../cmd/install"
  6. install -D, multi src
  7. $ test ! -e gran
  8. $ touch sis bro
  9. $ install -D sis bro gran/dad
  10. $ test -f sis
  11. $ test -f bro
  12. $ test -d gran/dad
  13. $ test -f gran/dad/sis
  14. $ test -f gran/dad/bro
  15. $ rm -r sis bro gran
  16. install -T
  17. $ test ! -e src_T
  18. $ touch src_T
  19. $ test -e src_T
  20. $ install -T src_T dest_T
  21. $ test -e src_T
  22. $ test -e dest_T
  23. $ rm dest_T
  24. $ install -T src_T src2_T bogus_T
  25. install: error: Option -T passed, expected exactly 1 source operand, got 2
  26. [1]
  27. $ test -e src_T
  28. $ test ! -e src2_T
  29. $ test ! -e bogus_T
  30. $ rm src_T
  31. install -t
  32. $ touch src1_t src2_t
  33. $ test -e src1_t
  34. $ test -e src2_t
  35. $ mkdir dest_t
  36. $ test -d dest_t
  37. $ test ! -e dest_t/src1_t
  38. $ test ! -e dest_t/src2_t
  39. $ install -t dest_t src1_t src2_t
  40. $ test -e src1_t
  41. $ test -e src2_t
  42. $ test -e dest_t/src1_t
  43. $ test -e dest_t/src2_t
  44. $ rm -r dest_t src1_t src2_t
  45. No files should be left
  46. $ find .
  47. .