diff options
Diffstat (limited to 'backend/scripts')
| -rw-r--r-- | backend/scripts/patch-medusa.js | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/backend/scripts/patch-medusa.js b/backend/scripts/patch-medusa.js index 9d95d9a..f44f23c 100644 --- a/backend/scripts/patch-medusa.js +++ b/backend/scripts/patch-medusa.js @@ -1,34 +1,34 @@ -const fs = require("fs"); -const path = require("path"); - -const targetPath = path.join( - __dirname, - "..", - "node_modules", - "@medusajs", - "medusa", - "dist", - "services", - "payment-provider.js" -); - -if (!fs.existsSync(targetPath)) { - console.error("patch-medusa: cible introuvable:", targetPath); - process.exit(1); -} - -const original = fs.readFileSync(targetPath, "utf8"); -const before = "model.update({}, { is_installed: false })"; -const after = - "model.createQueryBuilder().update().set({ is_installed: false }).where('1=1').execute()"; - -if (!original.includes(before)) { - console.error( - "patch-medusa: motif introuvable, le patch n'a pas ete applique." - ); - process.exit(1); -} - -const patched = original.replace(before, after); -fs.writeFileSync(targetPath, patched, "utf8"); -console.log("patch-medusa: update vide remplace avec succes."); +const fs = require("fs");
+const path = require("path");
+
+const targetPath = path.join(
+ __dirname,
+ "..",
+ "node_modules",
+ "@medusajs",
+ "medusa",
+ "dist",
+ "services",
+ "payment-provider.js"
+);
+
+if (!fs.existsSync(targetPath)) {
+ console.error("patch-medusa: cible introuvable:", targetPath);
+ process.exit(1);
+}
+
+const original = fs.readFileSync(targetPath, "utf8");
+const before = "model.update({}, { is_installed: false })";
+const after =
+ "model.createQueryBuilder().update().set({ is_installed: false }).where('1=1').execute()";
+
+if (!original.includes(before)) {
+ console.error(
+ "patch-medusa: motif introuvable, le patch n'a pas ete applique."
+ );
+ process.exit(1);
+}
+
+const patched = original.replace(before, after);
+fs.writeFileSync(targetPath, patched, "utf8");
+console.log("patch-medusa: update vide remplace avec succes.");
|
