Skip to content

Commit c8736d0

Browse files
committed
fix: another attempt at node12 support
1 parent ad9dec5 commit c8736d0

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/shared/localShadowRepo.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ export class ShadowRepo extends AsyncCreatable<ShadowRepoOptions> {
7979
}
8080

8181
public async delete(): Promise<string> {
82-
await fs.promises.rm(this.gitDir, { recursive: true, force: true });
82+
if (typeof fs.promises.rm === 'function') {
83+
await fs.promises.rm(this.gitDir, { recursive: true, force: true });
84+
} else {
85+
fs.rmdirSync(this.gitDir, { recursive: true });
86+
}
8387
return this.gitDir;
8488
}
8589
/**

src/shared/remoteSourceTrackingService.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class RemoteSourceTrackingService extends ConfigFile<RemoteSourceTracking
133133
const fileToDelete = RemoteSourceTrackingService.getFilePath(orgId);
134134
// the file might not exist, in which case we don't need to delete it
135135
if (fs.existsSync(fileToDelete)) {
136-
await fs.promises.rm(fileToDelete, { recursive: true });
136+
await fs.promises.unlink(fileToDelete);
137137
}
138138
return path.isAbsolute(fileToDelete) ? fileToDelete : path.join(process.cwd(), fileToDelete);
139139
}

test/nuts/commands/basics.nut.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ describe('end-to-end-test for tracking with an org (single packageDir)', () => {
7272
it('sees a local delete in local status', async () => {
7373
const classDir = path.join(session.project.dir, 'force-app', 'main', 'default', 'classes');
7474
await Promise.all([
75-
fs.promises.rm(path.join(classDir, 'TestOrderController.cls')),
76-
fs.promises.rm(path.join(classDir, 'TestOrderController.cls-meta.xml')),
75+
fs.promises.unlink(path.join(classDir, 'TestOrderController.cls')),
76+
fs.promises.unlink(path.join(classDir, 'TestOrderController.cls-meta.xml')),
7777
]);
7878
const result = execCmd<StatusResult[]>('force:source:status --json --local', { ensureExitCode: 0 }).jsonOutput
7979
.result;

0 commit comments

Comments
 (0)