Skip to content

Commit

Permalink
Update init to add config to Zapier build includes
Browse files Browse the repository at this point in the history
  • Loading branch information
oojacoboo committed Oct 12, 2023
1 parent d97c648 commit 9be0448
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,13 @@ const createDefaultConfigFile = async (urlEnvVar) => {
const file = `${process.cwd()}/.zapiergraphql`;
await fs.writeFileSync(file, contents);

// Need to be sure to update the default Zapier config to include our config file in builds
const zapierConfigFile = `${process.cwd()}/.zapierapprc`;
const zapierConfig = JSON.parse(fs.readFileSync(zapierConfigFile, 'utf8'));
zapierConfig.includeInBuild = zapierConfig.includeInBuild || [];
zapierConfig.includeInBuild.push('.zapiergraphql');
await fs.writeFileSync(zapierConfigFile, JSON.stringify(zapierConfig, null, 2));

return { file, contents };
}

Expand Down

0 comments on commit 9be0448

Please sign in to comment.