Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

test.sh 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. #
  3. # Automated cordova tests. Installs the correct cordova platform,
  4. # installs the plugin, installs the test app, and then runs it on
  5. # a device or emulator.
  6. #
  7. # usage: ./bin/test.sh [android|ios]
  8. #
  9. # N.B. if you functionally change this script you _must_ change .\bin\test.sh too.
  10. #
  11. # STATUS: UNSUPPORTED
  12. #
  13. # A known issue is that this script needs old coffeescript@1 or coffee-script@1
  14. # to be installed globally while the package script is using locally installed
  15. # version of coffeescript@1.
  16. #
  17. # It is recommended to use the package scripts with npm or yarn tool instead
  18. # of this script.
  19. #
  20. platform=$1
  21. if [[ -z $platform ]]; then
  22. echo "usage: ./bin/test.sh [android|ios]"
  23. exit 1
  24. fi
  25. if [[ ! -x $(which coffee) ]]; then
  26. echo "you need coffeescript. please install with:"
  27. echo "npm install -g coffee-script"
  28. exit 1
  29. fi
  30. if [[ ! -x $(which cordova) ]]; then
  31. echo "you need cordova. please install with:"
  32. echo "npm install -g cordova"
  33. exit 1
  34. fi
  35. cd spec
  36. if [[ $? != 0 ]]; then # run from the bin/ directory
  37. cd ../spec
  38. fi
  39. # compile coffeescript
  40. coffee --no-header -cl -o ../www ../SQLitePlugin.coffee.md
  41. if [[ $? != 0 ]]; then
  42. echo "coffeescript compilation failed"
  43. exit 1
  44. fi
  45. echo "compiled coffeescript to javascript"
  46. # move everything to a temp folder to avoid infinite recursion errors
  47. rm -fr myplugin
  48. mkdir -p myplugin
  49. cp -r ../scripts ../src ../plugin.xml ../package.json ../www myplugin
  50. # cleanup old test
  51. rm -fr plugins platforms
  52. # update the plugin, run the test app
  53. cordova platform add $platform
  54. #cordova plugin rm com.brodysoft.sqlitePlugin
  55. cordova plugin add myplugin
  56. cordova run $platform