Skip to content

Commit

Permalink
fix: case of empty orgId dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Oct 5, 2021
1 parent 3ba883f commit 1cb6333
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compatibility.ts
Expand Up @@ -18,8 +18,9 @@ type TrackingFileVersion = 'plugin-source' | 'toolbelt' | 'none';
*/
export const getTrackingFileVersion = (org: Org, projectPath: string): TrackingFileVersion => {
const orgsDir = path.join(projectPath, '.sfdx', 'orgs');
const newFilesDir = path.join(orgsDir, org.getOrgId());
// has new tracking files based on orgId
if (fs.existsSync(path.join(orgsDir, org.getOrgId()))) {
if (fs.existsSync(newFilesDir) && fs.readdirSync(newFilesDir).length > 0) {
return 'plugin-source';
}
const username = org.getUsername();
Expand Down

0 comments on commit 1cb6333

Please sign in to comment.