Comments (3)
That is because you did not run gitinfo
task before accessing it. Below should work:
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-gitinfo');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
gitinfo: {},
});
grunt.registerTask('yourWriteFunction', 'Write', function () {
var git = grunt.config('gitinfo');
console.log(git);
});
grunt.registerTask('version', 'qeues tasks', function() {
//Run gitinfo task
grunt.task.run('gitinfo');
//Run your write function
grunt.task.run('yourWriteFunction');
});
}
from grunt-gitinfo.
Hi @damkraw,
I have an issue with my Gruntfile and I hope you could help me figure it out.
Warning: An error occurred while processing a template (Cannot read property 'branch' of undefined). Use --force to continue.
I'd be grateful if you could take a look at my Gruntfile.js
Thanks
from grunt-gitinfo.
Forget about it, I fixed it by adding the gitinfo
as the first task in my build task.
from grunt-gitinfo.
Related Issues (12)
- Example of usage HOT 1
- Remove leading and trailing quotes from results HOT 1
- Tag Releases in git HOT 3
- use output of custom commands in other custom commands
- Update peerDependencies to support Grunt 1.0
- Can't use git-info after 'git gc'
- git formatted output with quotes HOT 4
- lodash version is outdated HOT 2
- It just doesn't work... no matter all the different variations I tried... HOT 2
- Getting error with new version (0.1.2) HOT 2
- If you don't have any tags an error is shown HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-gitinfo.