Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed gulp version task to work with release-it #5393

Merged
merged 7 commits into from Dec 19, 2022
11 changes: 8 additions & 3 deletions gulpfile.js
@@ -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!');
});

Expand Down Expand Up @@ -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'));
Expand Down