amxxpack 1.4.5 → 1.4.6

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.
@@ -468,7 +468,7 @@ var AmxxBuilder = /** @class */ (function () {
468
468
  switch (_a.label) {
469
469
  case 0:
470
470
  pathPattern = (0, lodash_1.map)(this.projectConfig.input.scripts, function (dir) { return path_1.default.join(dir, '**', pattern); });
471
- return [4 /*yield*/, globule_1.default.find(pathPattern)];
471
+ return [4 /*yield*/, globule_1.default.find(pathPattern, { nodir: true })];
472
472
  case 1:
473
473
  matches = _a.sent();
474
474
  return [2 /*return*/, matches.filter(function (filePath) { return path_1.default.extname(filePath) === '.sma'; })];
@@ -479,9 +479,10 @@ var AmxxBuilder = /** @class */ (function () {
479
479
  AmxxBuilder.prototype.compilePlugin = function (srcDir, srcFile, compileOptions) {
480
480
  if (compileOptions === void 0) { compileOptions = {}; }
481
481
  return __awaiter(this, void 0, void 0, function () {
482
- var srcPath, _a, scriptName, srcNestedDir, destDir, pluginDest, isUpdated, _b, relateiveSrcPath, executablePath, result, destPath, relativeFilePath;
483
- return __generator(this, function (_c) {
484
- switch (_c.label) {
482
+ var srcPath, _a, scriptName, srcNestedDir, destDir, pluginDest, isUpdated, _b, relateiveSrcPath, executablePath, result, _c, _d, _e, destPath, relativeFilePath;
483
+ var _f;
484
+ return __generator(this, function (_g) {
485
+ switch (_g.label) {
485
486
  case 0:
486
487
  if (!this.projectConfig.output.plugins) {
487
488
  return [2 /*return*/];
@@ -495,8 +496,8 @@ var AmxxBuilder = /** @class */ (function () {
495
496
  return [3 /*break*/, 3];
496
497
  case 1: return [4 /*yield*/, this.pluginCache.isPluginUpdated(srcPath, pluginDest)];
497
498
  case 2:
498
- _b = _c.sent();
499
- _c.label = 3;
499
+ _b = _g.sent();
500
+ _g.label = 3;
500
501
  case 3:
501
502
  isUpdated = _b;
502
503
  relateiveSrcPath = path_1.default.relative(process.cwd(), srcPath);
@@ -507,28 +508,35 @@ var AmxxBuilder = /** @class */ (function () {
507
508
  executablePath = path_1.default.join(this.projectConfig.compiler.dir, this.projectConfig.compiler.executable);
508
509
  return [4 /*yield*/, (0, mkdirp_1.default)(destDir)];
509
510
  case 4:
510
- _c.sent();
511
- return [4 /*yield*/, (0, amxxpc_1.default)({
512
- path: srcPath,
513
- dest: pluginDest,
514
- compiler: executablePath,
515
- includeDir: __spreadArray(__spreadArray([
516
- path_1.default.join(this.projectConfig.compiler.dir, 'include')
517
- ], this.projectConfig.include, true), this.projectConfig.input.include, true)
518
- })];
511
+ _g.sent();
512
+ _c = amxxpc_1.default;
513
+ _f = {
514
+ path: srcPath,
515
+ dest: pluginDest,
516
+ compiler: executablePath
517
+ };
518
+ _d = [[
519
+ path_1.default.join(this.projectConfig.compiler.dir, 'include')
520
+ ]];
521
+ return [4 /*yield*/, globule_1.default.find(this.projectConfig.include)];
519
522
  case 5:
520
- result = _c.sent();
521
- if (!!compileOptions.noCache) return [3 /*break*/, 9];
522
- if (!!result.error) return [3 /*break*/, 7];
523
+ _e = [__spreadArray.apply(void 0, _d.concat([_g.sent(), true]))];
524
+ return [4 /*yield*/, globule_1.default.find(this.projectConfig.input.include)];
525
+ case 6: return [4 /*yield*/, _c.apply(void 0, [(_f.includeDir = __spreadArray.apply(void 0, _e.concat([_g.sent(), true])),
526
+ _f)])];
527
+ case 7:
528
+ result = _g.sent();
529
+ if (!!compileOptions.noCache) return [3 /*break*/, 11];
530
+ if (!!result.error) return [3 /*break*/, 9];
523
531
  return [4 /*yield*/, this.pluginCache.updatePlugin(srcPath, pluginDest)];
524
- case 6:
525
- _c.sent();
526
- return [3 /*break*/, 9];
527
- case 7: return [4 /*yield*/, this.pluginCache.deletePlugin(srcPath)];
528
532
  case 8:
529
- _c.sent();
530
- _c.label = 9;
531
- case 9:
533
+ _g.sent();
534
+ return [3 /*break*/, 11];
535
+ case 9: return [4 /*yield*/, this.pluginCache.deletePlugin(srcPath)];
536
+ case 10:
537
+ _g.sent();
538
+ _g.label = 11;
539
+ case 11:
532
540
  result.output.messages.forEach(function (message) {
533
541
  var startLine = message.startLine, type = message.type, code = message.code, text = message.text, filename = message.filename;
534
542
  var relativeFilePath = filename ? path_1.default.relative(process.cwd(), filename) : relateiveSrcPath;
@@ -1,3 +1,3 @@
1
1
  export declare const SCRIPTS_PATH_PATTERN = "**/*.sma";
2
- export declare const INCLUDE_PATH_PATTERN = "**/*.inc";
2
+ export declare const INCLUDE_PATH_PATTERN = "*.inc";
3
3
  export declare const ASSETS_PATH_PATTERN = "**/*.*";
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ASSETS_PATH_PATTERN = exports.INCLUDE_PATH_PATTERN = exports.SCRIPTS_PATH_PATTERN = void 0;
4
4
  exports.SCRIPTS_PATH_PATTERN = '**/*.sma';
5
- exports.INCLUDE_PATH_PATTERN = '**/*.inc';
5
+ exports.INCLUDE_PATH_PATTERN = '*.inc';
6
6
  exports.ASSETS_PATH_PATTERN = '**/*.*';
@@ -247,7 +247,9 @@ var Controller = /** @class */ (function () {
247
247
  Controller.prototype.cleanCache = function () {
248
248
  return __awaiter(this, void 0, void 0, function () {
249
249
  return __generator(this, function (_a) {
250
- fs_1.default.promises.rm(config_1.default.cacheFile);
250
+ if (fs_1.default.existsSync(config_1.default.cacheFile)) {
251
+ fs_1.default.promises.rm(config_1.default.cacheFile);
252
+ }
251
253
  fs_1.default.promises.rm(config_1.default.downloadDir, { recursive: true, force: true });
252
254
  return [2 /*return*/];
253
255
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "amxxpack",
3
3
  "description": "AMXXPack",
4
4
  "author": "Hedgehog Fog",
5
- "version": "1.4.5",
5
+ "version": "1.4.6",
6
6
  "license": "MIT",
7
7
  "main": "lib/builder/index.js",
8
8
  "types": "lib/builder/index.d.ts",