Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7994

Faulty regex in check_reqs.js

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0.0
    • None
    • cordova-js
    • OS X 10.9.5

    Description

      I'm running cordova 4.0.0 on Os X 10.9.5.
      While trying to track an error message from file /Users/[user]/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js
      I noticed that some regular expressions appear to be faulty. Lines 52, 57, 58, 61 of module.exports.get_target() each contain:
      shelljs.grep(/...[\d+]/)
      There are a couple of problems:
      1) The '' is inside the brackets: [\d+] . On another note, \d by itself doesn't need to be in brackets. So in perl or egrep, either \d or [\d]+ would be fine.
      2) If this is calling grep, it doesn't use standard perl regex syntax, so neither '' nor '\d' work. This expression would work with egrep ('extended grep'), though. An alternate solution would be to use '*' instead of '', if it is not too general, as that works in grep.
      So, either grep with [0-9]* , or egrep with \d+

      Note: I am trying to solve this message, although fixing the regexes didn't accomplish it. When running 'ionic platform android':
      Error: Please install Android target "android-19".
      Hint: Run "android" from your command-line to open the SDK manager.
      at /Users/[user]/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:174:19

      Attachments

        Activity

          People

            Unassigned Unassigned
            Mark_L6n Mark L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: