@sasjs/cli 3.27.7 → 3.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,14 +100,25 @@ var compressAndSave_1 = require("../../utils/compressAndSave");
100
100
  var loadDependencies_1 = require("../compile/internal/loadDependencies");
101
101
  function build(target) {
102
102
  return __awaiter(this, void 0, void 0, function () {
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4 /*yield*/, (0, compile_1.compile)(target)];
103
+ var _a;
104
+ return __generator(this, function (_b) {
105
+ switch (_b.label) {
106
+ case 0:
107
+ _a = process.sasjsConstants.buildDestinationFolder;
108
+ if (!_a) return [3 /*break*/, 2];
109
+ return [4 /*yield*/, (0, utils_1.folderExists)(process.sasjsConstants.buildDestinationFolder)];
106
110
  case 1:
107
- _a.sent();
108
- return [4 /*yield*/, createFinalSasFiles(target)];
111
+ _a = !(_b.sent());
112
+ _b.label = 2;
109
113
  case 2:
110
- _a.sent();
114
+ if (!_a) return [3 /*break*/, 4];
115
+ return [4 /*yield*/, (0, compile_1.compile)(target)];
116
+ case 3:
117
+ _b.sent();
118
+ _b.label = 4;
119
+ case 4: return [4 /*yield*/, createFinalSasFiles(target)];
120
+ case 5:
121
+ _b.sent();
111
122
  return [2 /*return*/];
112
123
  }
113
124
  });
@@ -1,4 +1,4 @@
1
1
  import { Target } from '@sasjs/utils';
2
- export declare function compileSingleFile(target: Target, subCommand: string | undefined, source: string, output: string, insertProgramVar?: boolean): Promise<{
2
+ export declare function compileSingleFile(target: Target, subCommand: string | undefined, source: string, output: string, insertProgramVar?: boolean, currentFolder?: string): Promise<{
3
3
  destinationPath: string;
4
4
  }>;
@@ -46,7 +46,7 @@ var utils_1 = require("@sasjs/utils");
46
46
  var compileFile_1 = require("./internal/compileFile");
47
47
  var identifySasFile_1 = require("./internal/identifySasFile");
48
48
  var loadDependencies_1 = require("./internal/loadDependencies");
49
- function compileSingleFile(target, subCommand, source, output, insertProgramVar) {
49
+ function compileSingleFile(target, subCommand, source, output, insertProgramVar, currentFolder) {
50
50
  var _a;
51
51
  if (subCommand === void 0) { subCommand = 'identify'; }
52
52
  if (insertProgramVar === void 0) { insertProgramVar = false; }
@@ -67,7 +67,7 @@ function compileSingleFile(target, subCommand, source, output, insertProgramVar)
67
67
  throw new Error("'--source' flag is missing (eg '".concat(commandExample, "')"));
68
68
  }
69
69
  source = source.split('/').join(path_1.default.sep);
70
- sourcePath = (0, utils_1.getAbsolutePath)(source, process.currentDir);
70
+ sourcePath = (0, utils_1.getAbsolutePath)(source, currentFolder || process.currentDir);
71
71
  return [4 /*yield*/, validateSourcePath(sourcePath)];
72
72
  case 1:
73
73
  if (!(_c.sent())) {
package/package.json CHANGED
@@ -100,5 +100,5 @@
100
100
  "typescript": "4.5.4",
101
101
  "util": "0.12.4"
102
102
  },
103
- "version": "3.27.7"
103
+ "version": "3.28.0"
104
104
  }