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

Commit

Permalink
fix(): use require instead of context.requireCordovaModule
Browse files Browse the repository at this point in the history
  • Loading branch information
DURK authored and juanmiguelbesada committed Apr 17, 2019
1 parent 56cf6fd commit f197257
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions hooks/lib/ios/xcodePreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,21 @@ function loadProjectFile() {
projectFile = platform_ios.parseProjectFile(iosPlatformPath());
} catch (e) {
// Then cordova 7.0
var project_files = context.requireCordovaModule('glob').sync(path.join(iosPlatformPath(), '*.xcodeproj', 'project.pbxproj'));
var project_files = require('glob').sync(path.join(iosPlatformPath(), '*.xcodeproj', 'project.pbxproj'));

if (project_files.length === 0) {
throw new Error('does not appear to be an xcode project (no xcode project file)');
}

var pbxPath = project_files[0];

var xcodeproj = context.requireCordovaModule('xcode').project(pbxPath);
var xcodeproj = require('xcode').project(pbxPath);
xcodeproj.parseSync();

projectFile = {
'xcode': xcodeproj,
write: function () {
var fs = context.requireCordovaModule('fs');
var fs = require('fs');

var frameworks_file = path.join(iosPlatformPath(), 'frameworks.json');
var frameworks = {};
Expand All @@ -172,7 +172,7 @@ function loadProjectFile() {
fs.writeFileSync(pbxPath, xcodeproj.writeSync());
if (Object.keys(frameworks).length === 0){
// If there is no framework references remain in the project, just remove this file
context.requireCordovaModule('shelljs').rm('-rf', frameworks_file);
require('shelljs').rm('-rf', frameworks_file);
return;
}
fs.writeFileSync(frameworks_file, JSON.stringify(this.frameworks, null, 4));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-deeplinks",
"version": "1.1.0",
"version": "1.1.1",
"description": "Cordova plugin to add in your application support for Universal Links (iOS 9) and Deep Links (Android). Basically, open application through the link in the browser.",
"cordova": {
"id": "cordova-plugin-deeplinks",
Expand Down

1 comment on commit f197257

@Badisi
Copy link

@Badisi Badisi commented on f197257 May 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is required for Cordova 9.x which was released 2 months ago.
What's stopping you guys from releasing it ?
Thanks

Please sign in to comment.