Skip to content

Commit

Permalink
Updating npm scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ctd1500 committed Jun 23, 2020
1 parent 5aba5bd commit 0f609f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
build/*
dist/*
package-lock.json
.github.json
6 changes: 2 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = function(grunt) {
require('time-grunt')(grunt);
var baseName = 'videojs.hotkeys';
var pkg = grunt.file.readJSON('package.json');
var version = pkg.version;

// Project configuration.
grunt.initConfig({
Expand Down Expand Up @@ -71,7 +70,7 @@ module.exports = function(grunt) {
repository: 'ctd1500/videojs-hotkeys',
authentication: {
type: 'token',
token: process.env.GITHUB_TERM
token: grunt.file.readJSON('.github.json').token
},
release: {
tag_name: 'v<%= pkg.version %>',
Expand All @@ -96,9 +95,8 @@ module.exports = function(grunt) {

grunt.registerTask('buildver', 'Update version', function() {
var m = grunt.file.read(baseName + '.js');
var version = pkg.version;

m = m.replace(/(version: ")\d+\.\d+(\.\d+)?(")/g, '$1' + version + '$3');
m = m.replace(/(version: ")\d+\.\d+(\.\d+)?(")/g, '$1' + pkg.version + '$3');
grunt.file.write(baseName + '.js', m);
});

Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@
"grunt-contrib-uglify": "^3.0.1",
"grunt-github-releaser2": "^0.1.1",
"time-grunt": "^1.4.0"
},
"scripts": {
"build": "grunt",
"release": "grunt release"
}
}

0 comments on commit 0f609f3

Please sign in to comment.