Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Apr 27, 2024
1 parent 4e432e8 commit f643968
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Api.js
Expand Up @@ -279,9 +279,9 @@ class Api {
return this.addPodSpecs(plugin, podSpecs, installOptions);
}
})
.then(()=>{
.then(() => {
if (plugin != null && fs.existsSync(path.join(plugin.dir, 'Package.swift'))) {
return this.updatePackageSwift(plugin, "add");
return this.updatePackageSwift(plugin, 'add');
}
})
// CB-11022 Return truthy value to prevent running prepare after
Expand Down Expand Up @@ -330,9 +330,9 @@ class Api {
return this.removePodSpecs(plugin, podSpecs, uninstallOptions);
}
})
.then(()=>{
.then(() => {
if (plugin != null && fs.existsSync(path.join(plugin.dir, 'Package.swift'))) {
return this.updatePackageSwift(plugin, "remove");
return this.updatePackageSwift(plugin, 'remove');
}
})
// CB-11022 Return truthy value to prevent running prepare after
Expand Down Expand Up @@ -527,15 +527,15 @@ class Api {
* @param {PluginInfo} plugin plugin to edit the Package.swift with
* @param {String} mode Add or remove plugin
*/
updatePackageSwift(plugin, mode) {
updatePackageSwift (plugin, mode) {
const project_dir = this.locations.root;
const pluginDep = `
package.dependencies.append(.package(name: "${plugin.id}", path: "../../../plugins/${plugin.id}"))
package.targets.first?.dependencies.append(.product(name: "${plugin.id}", package: "${plugin.id}"))
`;
const packagePath = path.join(project_dir, 'CordovaPluginsSPM', 'Package.swift');
let packageContent = fs.readFileSync(packagePath, 'utf8');
if (mode === "add") {
if (mode === 'add') {
packageContent = packageContent + pluginDep;
} else {
packageContent = packageContent.replace(pluginDep, '');
Expand Down

0 comments on commit f643968

Please sign in to comment.