vojtajina / grunt-bump

Grunt.js plugin - Increment package version.
MIT License
651 stars 122 forks source link

Version Comes back as Undefined #197

Open spyke01 opened 7 years ago

spyke01 commented 7 years ago

When I run the bump it successfully bumps the version in the package but other items relying on the version get undefined instead of a version number.

Here's my bump config:

        // Handle updating the version number
        bump: {
            options: {
                files:         ['package.json'],
                updateConfigs: ['pkg'],
                commit: false,
                push: false
            }

        },

Here's the code that I'm using to pull the updated pkg item

        'string-replace': {
            version: {
                files: {
                    'dist/includes/constants.php': 'includes/constants.php',
                },
                options: {
                    replacements: [{
                        pattern: /{{ VERSION }}/g,
                        replacement: grunt.config.get('pkg.version')
                    }]
                }
            }
        },

Any idea what's happening here?

msmid commented 7 years ago

Hi,

try to get pkg.version like this grunt.config('pkg.version')

spyke01 commented 7 years ago

I still get undefined afterwards.

eddiemonge commented 6 years ago

Whats your config for setting the pkg version?