mirror of
https://github.com/iv-org/videojs-quality-selector.git
synced 2025-04-25 01:39:20 -04:00
Merge pull request #91 from yokuze/yokuze/fix_install_from_git_hash_issue
build: prevent error thrown when installed from a git URL
This commit is contained in:
commit
a40e9a6803
16
Gruntfile.js
16
Gruntfile.js
@ -10,7 +10,17 @@ const sass = require('sass');
|
|||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
var DEBUG = !!grunt.option('debug'),
|
var DEBUG = !!grunt.option('debug'),
|
||||||
config;
|
pkgJSON = grunt.file.readJSON('package.json'),
|
||||||
|
config, versionInfo;
|
||||||
|
|
||||||
|
try {
|
||||||
|
versionInfo = getCodeVersion.both();
|
||||||
|
} catch(e) {
|
||||||
|
// When this package is installed as a git URL, getCodeVersion throws an error and
|
||||||
|
// is not able to find the git version for this package. So, we fall back to using
|
||||||
|
// the version number from package.json
|
||||||
|
versionInfo = pkgJSON.version;
|
||||||
|
}
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
js: {
|
js: {
|
||||||
@ -41,8 +51,8 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: pkgJSON,
|
||||||
versionInfo: getCodeVersion.both(),
|
versionInfo: versionInfo,
|
||||||
config: config,
|
config: config,
|
||||||
|
|
||||||
browserify: {
|
browserify: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user