mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 15:33:22 +00:00
40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
// Chemins vers les fichiers
|
|
const rootPackageJsonPath = path.resolve(__dirname, "../package.json");
|
|
const rootPackageJson = JSON.parse(
|
|
fs.readFileSync(rootPackageJsonPath, "utf8")
|
|
);
|
|
// Lire la version actuelle du package.json principal
|
|
const newVersion = rootPackageJson.version;
|
|
|
|
const frontendPackageJsonPath = path.resolve(
|
|
__dirname,
|
|
"../Front-End/package.json"
|
|
);
|
|
// Lire et mettre à jour le package.json du sous-module
|
|
const frontendPackageJson = JSON.parse(
|
|
fs.readFileSync(frontendPackageJsonPath, "utf8")
|
|
);
|
|
frontendPackageJson.version = newVersion;
|
|
// Écrire les changements dans le fichier frontend/package.json
|
|
fs.writeFileSync(
|
|
frontendPackageJsonPath,
|
|
JSON.stringify(frontendPackageJson, null, 2),
|
|
"utf8"
|
|
);
|
|
// eslint-disable-next-line no-console
|
|
console.log(`Version mise à jour dans frontend/package.json : ${newVersion}`);
|
|
|
|
// Chemin vers le fichier Python de version
|
|
const versionFilePath = path.resolve(__dirname, "../Back-End/__version__.py");
|
|
|
|
// Mettre à jour le fichier Python
|
|
const versionContent = `__version__ = "${newVersion}"\n`;
|
|
fs.writeFileSync(versionFilePath, versionContent, "utf8");
|
|
// eslint-disable-next-line no-console
|
|
console.log(
|
|
`Version du backend mise à jour dans ${versionFilePath} : ${newVersion}`
|
|
);
|