Skip to content

Commit

Permalink
fix: fixed so we cleanup specific files for projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Simen Daehlin committed Sep 14, 2022
1 parent 4e586ed commit 0983455
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 0 additions & 2 deletions cli/commands/reset/reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const reset = async () => {
const projectType = await detect.projectType();

const detectedProviderName = await detect.provider();
console.log(detectedProviderName);

const { environments, provider } = await askResetQuestions(
detectedProviderName
);
Expand Down
6 changes: 5 additions & 1 deletion providers/heroku/heroku.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const outputs = require(`../../cli/outputs`);
const { generateHerokuServices } = require(`./generateHerokuServices`);
const { destroyHerokuApp } = require(`./destroyHerokuApp`);
const { herokuAuthenticate, netrcExists } = require(`./authentication`);
const { file } = require(`../../core`);

const herokuSetup = async ({ config, herokuConfig }) => {
outputs.info(`Generating heroku configuration file`);
Expand Down Expand Up @@ -34,12 +35,15 @@ module.exports = {
if (!netrcExists()) await herokuAuthenticate();
},
async build({ config, providerConfig }) {
await herokuSetup({ config, herokuConfig: providerConfig });
if (config.useDocker) {
await herokuSetup({ config, herokuConfig: providerConfig });
}
},
async postbuild({ config, providerConfig }) {
await generateHerokuServices({ config, herokuConfig: providerConfig });
},
async destroy({ config, providerConfig }) {
await file.remove(providerConfig.outputFileName);
await destroyHerokuApp({ config, herokuConfig: providerConfig });
}
}
Expand Down
5 changes: 4 additions & 1 deletion providers/render/render.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const chalk = require(`chalk`);
const { spinner } = require(`../../utils`);
const { renderQuestions } = require(`../../core`);
const outputs = require(`../../cli/outputs`);
const { generateRenderTemplate } = require(`./renderFile`);
const { file } = require(`../../core`);

const renderSetup = async ({ config, renderConfig }) => {
outputs.info(`Generating render configuration file`);
Expand Down Expand Up @@ -35,6 +35,9 @@ module.exports = {
renderHooks: {
async build({ config, providerConfig }) {
await renderSetup({ config, renderConfig: providerConfig });
},
async destroy({ config, providerConfig }) {
await file.remove(providerConfig.outputFileName);
}
}
};

0 comments on commit 0983455

Please sign in to comment.