ember-cli-deploy / ember-cli-deploy-revision-data

An ember-cli-plugin to create a unique revision key for the build
MIT License
22 stars 57 forks source link

type: 'git-commit' doesn't work from git submodule #21

Open mrloop opened 9 years ago

mrloop commented 9 years ago

Related to https://github.com/rwjblue/git-repo-info/pull/11

From a git submodule I get the following error

+- prepare
|  |
|  +- revision-data
|    - creating revision data using `git-commit`
|
+- didFail
TypeError: Cannot read property 'slice' of null
TypeError: Cannot read property 'slice' of null
  at CoreObject.module.exports.CoreObject.extend.generate (/home/ewan/projects/questionr/main/node_modules/ember-cli-deploy-revision-data/lib/data-generators/git-commit.js:14:23)

As a workaround in deploy.js I'm using

var exec = require('child_process').execSync;

....

redis: {
  revisionKey: function(){
    return exec('git rev-parse --short --verify HEAD').toString().replace('\n',''); 
  }
}
jrowlingson commented 9 years ago

@achambers I believe the PR above should resolve this.