@prestashopcorp/builtfor-generator-vanilla
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -62,2 +62,21 @@ "use strict"; | ||
yield (0, replace_in_file_1.replaceInFile)({ | ||
files: (0, path_1.join)(this.moduleDirectory, Generator.entrypointFilename), | ||
from: /<%SERVICE%>/g, | ||
to: this.options.template === 'standard' | ||
? '' | ||
: `try { | ||
// Load service for PrestaShop Billing | ||
$billingService = $this->getService('<%PRODUCT_ID%>.ps_billings_service'); | ||
$productComponents = $billingService->getProductComponents(); | ||
if (!empty($productComponents['body']['items'])) | ||
{ | ||
$componentItems = $productComponents['body']['items']; | ||
} | ||
} catch (Exception $e) { | ||
$this->context->controller->errors[] = $e->getMessage(); | ||
} | ||
`, | ||
countMatches: true, | ||
}); | ||
yield (0, replace_in_file_1.replaceInFile)({ | ||
files: (0, path_1.join)(this.moduleDirectory, '**'), | ||
@@ -135,21 +154,2 @@ ignore: (0, path_1.join)(this.moduleDirectory, 'vendor', '**'), | ||
yield (0, replace_in_file_1.replaceInFile)({ | ||
files: (0, path_1.join)(this.moduleDirectory, Generator.entrypointFilename), | ||
from: /<%SERVICE%>/g, | ||
to: this.options.template === 'standard' | ||
? '' | ||
: `try { | ||
// Load service for PrestaShop Billing | ||
$billingService = $this->getService('<%PRODUCT_ID%>.ps_billings_service'); | ||
$productComponents = $billingService->getProductComponents(); | ||
if (!empty($productComponents['body']['items'])) | ||
{ | ||
$componentItems = $productComponents['body']['items']; | ||
} | ||
} catch (Exception $e) { | ||
$this->context->controller->errors[] = $e->getMessage(); | ||
} | ||
`, | ||
countMatches: true, | ||
}); | ||
yield (0, replace_in_file_1.replaceInFile)({ | ||
files: (0, path_1.join)(this.moduleDirectory, Generator.billingJsFilename), | ||
@@ -156,0 +156,0 @@ from: /<%CUSTOM_CANCELLATION%>/g, |
{ | ||
"name": "@prestashopcorp/builtfor-generator-vanilla", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Built for PS generator with customization option", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -77,2 +77,23 @@ import { existsSync } from 'fs'; | ||
await replaceInFile({ | ||
files: join(this.moduleDirectory, Generator.entrypointFilename), | ||
from: /<%SERVICE%>/g, | ||
to: | ||
this.options.template === 'standard' | ||
? '' | ||
: `try { | ||
// Load service for PrestaShop Billing | ||
$billingService = $this->getService('<%PRODUCT_ID%>.ps_billings_service'); | ||
$productComponents = $billingService->getProductComponents(); | ||
if (!empty($productComponents['body']['items'])) | ||
{ | ||
$componentItems = $productComponents['body']['items']; | ||
} | ||
} catch (Exception $e) { | ||
$this->context->controller->errors[] = $e->getMessage(); | ||
} | ||
`, | ||
countMatches: true, | ||
}); | ||
await replaceInFile({ | ||
files: join(this.moduleDirectory, '**'), | ||
@@ -153,23 +174,2 @@ ignore: join(this.moduleDirectory, 'vendor', '**'), | ||
await replaceInFile({ | ||
files: join(this.moduleDirectory, Generator.entrypointFilename), | ||
from: /<%SERVICE%>/g, | ||
to: | ||
this.options.template === 'standard' | ||
? '' | ||
: `try { | ||
// Load service for PrestaShop Billing | ||
$billingService = $this->getService('<%PRODUCT_ID%>.ps_billings_service'); | ||
$productComponents = $billingService->getProductComponents(); | ||
if (!empty($productComponents['body']['items'])) | ||
{ | ||
$componentItems = $productComponents['body']['items']; | ||
} | ||
} catch (Exception $e) { | ||
$this->context->controller->errors[] = $e->getMessage(); | ||
} | ||
`, | ||
countMatches: true, | ||
}); | ||
await replaceInFile({ | ||
files: join(this.moduleDirectory, Generator.billingJsFilename), | ||
@@ -176,0 +176,0 @@ from: /<%CUSTOM_CANCELLATION%>/g, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
98644