Skip to content

Commit

Permalink
fix(cli): Don't add google-services plugin if missing (#5825)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Aug 4, 2022
1 parent 66954ef commit 48ff9e6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cli/src/tasks/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ async function updateBuildGradle(
) {
// In build.gradle add dependencies:
// classpath 'com.android.tools.build:gradle:7.2.1'
// classpath 'com.google.gms:google-services:4.3.10'
// classpath 'com.google.gms:google-services:4.3.13'
const txt = readFile(filename);
if (!txt) {
return;
Expand All @@ -474,13 +474,7 @@ async function updateBuildGradle(
let replaced = txt;

for (const dep of Object.keys(neededDeps)) {
if (!replaced.includes(`classpath '${dep}`)) {
replaced = txt.replace(
'dependencies {',
`dependencies {\n classpath '${dep}:${neededDeps[dep]}'`,
);
} else {
// Update
if (replaced.includes(`classpath '${dep}`)) {
replaced = setAllStringIn(
replaced,
`classpath '${dep}:`,
Expand Down

0 comments on commit 48ff9e6

Please sign in to comment.