UNPKG

@timescaledb/utils

Version:

This package contains utilities like formatting and escaping sql strings plus other helper functions.

29 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const child_process_1 = require("child_process"); const version = process.env.VERSION; const startPath = process.env.START_PATH; function releaseNewVersion() { const branch = (0, child_process_1.execSync)('git symbolic-ref --short HEAD').toString().trim(); if (branch !== 'main') { console.error('Error: You must be on the main branch to release a new version.'); process.exit(1); } (0, child_process_1.execSync)('git pull'); (0, child_process_1.execSync)(`VERSION=${version} IGNORE_WORKSPACE=true START_PATH=${startPath} node ./packages/utils/dist/bump-versions.js`); (0, child_process_1.execSync)('pnpm i'); (0, child_process_1.execSync)('pnpm format'); (0, child_process_1.execSync)('git add .'); (0, child_process_1.execSync)(`git commit -m "${version}"`); (0, child_process_1.execSync)(`git tag ${version}`); } if (!version) { console.error('Please set the VERSION environment variable.'); process.exit(1); } if (!startPath) { console.error('Please set the START_PATH environment variable.'); process.exit(1); } releaseNewVersion(); //# sourceMappingURL=release.js.map