_example.js 1011 B

123456789101112131415161718192021222324252627282930
  1. // Name of the module.
  2. module.exports.name = 'example module'
  3. // Description of the module
  4. module.exports.description = 'An example module to show how it works'
  5. // Specify this reporter requires a backup.
  6. // The second parameter to func() is now a backup instead of the path to one.
  7. module.exports.requiresBackup = true
  8. // Specify this only works for iOS 10+
  9. module.exports.supportedVersions = '>=10.0'
  10. // Reporting function
  11. module.exports.func = function (program, backup) {
  12. // This function will be called with the `commander` program, and the iPhoneBackup instance as arguments
  13. }
  14. // --- OR ---
  15. // You can also provide an array of functions instead of using `module.exports.func`.
  16. // These functions *should* be independent ranges to ensure reliable execution
  17. module.exports.functions = {
  18. '>=10.0': function(program,backup) {
  19. // This function would be called for iOS 10+
  20. },
  21. '>=9.0,<10.0': function(program,backup) {
  22. // This function would be called for all iOS 9.
  23. }
  24. }