grunt-bump icon indicating copy to clipboard operation
grunt-bump copied to clipboard

Version Comes back as Undefined

Open spyke01 opened this issue 8 years ago • 3 comments

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?

spyke01 avatar Jan 02 '17 17:01 spyke01

Hi,

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

msmid avatar Jan 06 '17 11:01 msmid

I still get undefined afterwards.

spyke01 avatar Jan 06 '17 18:01 spyke01

Whats your config for setting the pkg version?

eddiemonge avatar Apr 10 '18 18:04 eddiemonge