2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

chore(ci): fix version bump script by adding bump argument for target version;

This commit is contained in:
Dmitriy Mozgovoy
2022-12-19 19:52:59 +02:00
committed by GitHub
parent 75217e690c
commit f12d01eed1
3 changed files with 724 additions and 605 deletions
+8 -3
View File
@@ -1,8 +1,11 @@
import gulp from 'gulp';
import fs from 'fs-extra';
import axios from './index.js';
import minimist from 'minimist'
gulp.task('default', async function(){
const argv = minimist(process.argv.slice(2));
gulp.task('default', async function(){
console.log('hello!');
});
@@ -70,8 +73,10 @@ const packageJSON = gulp.task('package', async function () {
const env = gulp.task('env', async function () {
var npm = JSON.parse(await fs.readFile('package.json'));
await fs.writeFile('./lib/env/data.js', Object.entries({
VERSION: npm.version
const envFilePath = './lib/env/data.js';
await fs.writeFile(envFilePath, Object.entries({
VERSION: (argv.bump || npm.version).replace(/^v/, '')
}).map(([key, value]) => {
return `export const ${key} = ${JSON.stringify(value)};`
}).join('\n'));