UNPKG

@sasjs/cli

Version:

Command line interface for SASjs

28 lines (27 loc) 1.38 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDestinationJobPath = exports.getDestinationServicePath = void 0; var path_1 = __importDefault(require("path")); var getDestinationServicePath = function (inputPath) { if (!inputPath) { throw new Error('Cannot get leaf folder name: input path is empty, null or undefined.'); } var buildDestinationServicesFolder = process.sasjsConstants.buildDestinationServicesFolder; var inputPathParts = inputPath.split(path_1.default.sep); var leafFolderName = inputPathParts.pop(); return path_1.default.join(buildDestinationServicesFolder, leafFolderName); }; exports.getDestinationServicePath = getDestinationServicePath; var getDestinationJobPath = function (inputPath) { if (!inputPath) { throw new Error('Cannot get leaf folder name: input path is empty, null or undefined.'); } var buildDestinationJobsFolder = process.sasjsConstants.buildDestinationJobsFolder; var inputPathParts = inputPath.split(path_1.default.sep); var leafFolderName = inputPathParts.pop(); return path_1.default.join(buildDestinationJobsFolder, leafFolderName); }; exports.getDestinationJobPath = getDestinationJobPath;