Skip to content

Commit

Permalink
Merge pull request #1463 from rirze/fix-rmdir-depreciation-warning
Browse files Browse the repository at this point in the history
chore: remove depreciation warning for `fs.rmdir`
  • Loading branch information
DanielMSchmidt authored Jan 7, 2022
2 parents 88e7168 + 565238c commit 3981c69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/cdktf-cli/bin/cmds/helper/synth-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Command output on stdout:
);

for (const orphanedDirectory of orphanedDirectories) {
fs.rmdirSync(orphanedDirectory, { recursive: true });
fs.rmSync(orphanedDirectory, { recursive: true });
}

return stacks;
Expand Down
7 changes: 3 additions & 4 deletions packages/cdktf-cli/bin/cmds/ui/models/terraform-cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,9 @@ export class TerraformCloud implements Terraform {

private removeLocalTerraformDirectory() {
try {
fs.rmdirSync(
path.resolve(this.stack.synthesizedStackPath, ".terraform"),
{ recursive: true }
);
fs.rmSync(path.resolve(this.stack.synthesizedStackPath, ".terraform"), {
recursive: true,
});
} catch (error) {
logger.debug(`Could not remove .terraform folder`, error);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cdktf/lib/terraform-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class TerraformAsset extends Resource {
// Cleanup existing assets
const previousVersionsFolder = path.join(basePath, this.namedFolder);
if (fs.existsSync(previousVersionsFolder)) {
fs.rmdirSync(previousVersionsFolder, { recursive: true });
fs.rmSync(previousVersionsFolder, { recursive: true });
}

const targetPath = path.join(basePath, this.path);
Expand Down

0 comments on commit 3981c69

Please sign in to comment.