Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Commit

Permalink
fixes #626
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptPilot authored and scriptPilot committed Jul 3, 2017
1 parent 3a5abfb commit d9865e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<br />

## Version 1.9.13
## Version 1.9.14

Released on 2017-07-03

Expand All @@ -13,6 +13,7 @@ Released on 2017-07-03
- [x] [#346 - Error on npm run ftp without proper FTP server data](https://github.com/scriptPilot/app-framework/issues/346)
- [x] [#592 - npm run android failed - Float types not allowed for versionCode](https://github.com/scriptPilot/app-framework/issues/592)
- [x] [#620 - Snapshot is created at initial installation](https://github.com/scriptPilot/app-framework/issues/620)
- [x] [#626 - npm run ios fails with "cannot read property 'replace' of undefined"](https://github.com/scriptPilot/app-framework/issues/626)

## Version 1.9.10

Expand Down
13 changes: 13 additions & 0 deletions scripts/cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,20 @@ let addCordovaPlatforms = function (callback) {
alert('Cordova platform installation ongoing - please wait ...')
if (env.arg.ios === true || env.arg.xcode === true) {
cmd(binDir, 'cordova platform add ios', function () {
// workaround: #626 - npm run ios fails with <cannot read property 'replace' of undefined>
try {
const filename = path.resolve(binDir, 'platforms/ios/cordova/node_modules/ios-sim/src/lib.js')
const string = 'list.push(util.format(\'%s, %s\', name_id_map[ deviceName ].replace(/^com.apple.CoreSimulator.SimDeviceType./, \'\'), runtime.replace(/^iOS /, \'\')));'
const wrapper = 'if (name_id_map[deviceName] && runtime) { ' + string + ' }'
let filecontent = fs.readFileSync(filename, 'utf8')
filecontent = filecontent.replace(string, wrapper)
fs.writeFileSync(filename, filecontent)
} catch (err) {
alert('Failed to apply workaround #626.')
}
// Alert
alert('Cordova platform installation done for Android.')
// Callback
callback()
}, function () {
alert('Cordova platform installation failed for iOS.', 'issue')
Expand Down

0 comments on commit d9865e3

Please sign in to comment.