From bc239cf5d66203048d1b72a2177f192222957b88 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Fri, 18 Sep 2020 17:40:35 +0100 Subject: [PATCH] fix(job-execution): fix program path for absolute path jobs --- src/SASViyaApiClient.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SASViyaApiClient.ts b/src/SASViyaApiClient.ts index 8084326..e63f7a7 100644 --- a/src/SASViyaApiClient.ts +++ b/src/SASViyaApiClient.ts @@ -1032,18 +1032,18 @@ export class SASViyaApiClient { let jobToExecute: Job | undefined let jobName: string | undefined + let jobPath: string | undefined if (isRelativePath(sasJob)) { const folderName = sasJob.split('/')[0] jobName = sasJob.split('/')[1] - const jobFolder = this.folderMap.get( - `${this.rootFolderName}/${folderName}` - ) + jobPath = `${this.rootFolderName}/${folderName}` + const jobFolder = this.folderMap.get(jobPath) jobToExecute = jobFolder?.find((item) => item.name === jobName) } else { const folderPathParts = sasJob.split('/') jobName = folderPathParts.pop() - const folderPath = folderPathParts.join('/') - const jobFolder = this.folderMap.get(folderPath) + jobPath = folderPathParts.join('/') + const jobFolder = this.folderMap.get(jobPath) jobToExecute = jobFolder?.find((item) => item.name === jobName) } @@ -1071,7 +1071,7 @@ export class SASViyaApiClient { const jobArguments: { [key: string]: any } = { _contextName: contextName, - _program: `${this.rootFolderName}/${sasJob}`, + _program: `${jobPath}/${sasJob}`, _webin_file_count: files.length, _OMITJSONLISTING: true, _OMITJSONLOG: true,