From 9055fd90ebfb0c665153a74ceba246c7660cd636 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Tue, 10 Sep 2024 14:40:01 -0600 Subject: [PATCH] chore: get name from path correctly --- .../convertContext/decomposedPermissionSetFinalizer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/convert/convertContext/decomposedPermissionSetFinalizer.ts b/src/convert/convertContext/decomposedPermissionSetFinalizer.ts index 8b8a835b2..5e606d4b0 100644 --- a/src/convert/convertContext/decomposedPermissionSetFinalizer.ts +++ b/src/convert/convertContext/decomposedPermissionSetFinalizer.ts @@ -4,7 +4,7 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { join } from 'node:path'; +import { join, sep } from 'node:path'; import { ensure, JsonMap } from '@salesforce/ts-types'; import type { PermissionSet } from '@jsforce/jsforce-node/lib/api/metadata/schema'; import { SfError } from '@salesforce/core'; @@ -66,7 +66,11 @@ export class DecomposedPermissionSetFinalizer extends ConvertTransactionFinalize private getName(): string { let name: string; try { - name = Array.from(this.transactionState.permissionSetChildByPath.keys())[0].split(':')[1].split('.')[0]; + name = Array.from(this.transactionState.permissionSetChildByPath.keys())[0] + .split(sep) + .slice(-1)[0] + .split(':')[0] + .split('.')[0]; } catch (e) { throw SfError.create({ cause: e,