@kontent-ai/core-sdk
Version:
Core package with shared / common functionality for Kontent.ai SDKs
12 lines • 657 B
JavaScript
import { readFileSync, writeFileSync } from "node:fs";
import chalk from "chalk";
const sdkVersionPlaceholderMacro = "{{version}}";
export function replaceSdkVersionPlaceholder(filePath, version) {
const fileContent = readFileSync(filePath, "utf8");
if (!fileContent.includes(sdkVersionPlaceholderMacro)) {
throw new Error(`File '${filePath}' does not contain macro '${sdkVersionPlaceholderMacro}'`);
}
writeFileSync(filePath, fileContent.replace(sdkVersionPlaceholderMacro, version));
console.log(`Updated SDK version in '${chalk.yellow(filePath)}' to '${chalk.green(version)}'`);
}
//# sourceMappingURL=sdk-version.utils.js.map