Skip to content

Commit

Permalink
Add package.json and gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemhall authored and Koha instance kohadev-koha committed Aug 5, 2016
1 parent 6772f6d commit 968f66e
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use JavaScript::Minifier qw(minify);


## Here we set our plugin version
our $VERSION = 2.00;
our $VERSION = "{VERSION}";

## Here is our metadata, some keys are required, some are optional
our $metadata = {
Expand Down
37 changes: 37 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const gulp = require('gulp');
const zip = require('gulp-zip');
const release = require('gulp-github-release');
const fs = require('fs');
const replace = require('gulp-replace');
const git = require('gulp-git');


var package_json = JSON.parse(fs.readFileSync('./package.json'));
var release_filename = package_json.name + '-v' + package_json.version + '.kpz';

var pm_file = 'CoverFlow.pm';
var pm_file_path = './Koha/Plugin/Com/ByWaterSolutions/';
var pm_file_path_full = pm_file_path + pm_file;

console.log(release_filename);

gulp.task('build', () => {
// Set module version
gulp.src(pm_file_path_full)
.pipe(replace('{VERSION}', package_json.version))
.pipe(gulp.dest(pm_file_path));

//FIXME: This doesn't work! It only zips of the first level of directories, leaving them empty
gulp.src(['./*', '!gulpfile.js', '!node_modules', '!package.json', '!README.md'])
.pipe(zip(release_filename))
.pipe(gulp.dest('./'));
});

gulp.task('release', () => {
gulp.src(release_filename)
.pipe(release({
manifest: require('./package.json') // package.json from which default values will be extracted if they're missing
}))
.pipe(git.checkoutFiles());
});

29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "koha-coverflow-plugin",
"version": "2.2.0",
"description": "Koha CoverFlow Plugin",
"main": "index.js",
"dependencies": {
"gulp-git": "^1.11.0",
"gulp-zip": "^3.2.0"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-cli": "^1.2.2",
"gulp-github-release": "^1.1.5",
"gulp-zip": "^3.2.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bywatersolutions/koha-plugin-coverflow.git"
},
"author": "Kyle M Hall <[email protected]>",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/bywatersolutions/koha-plugin-coverflow/issues"
},
"homepage": "https://github.com/bywatersolutions/koha-plugin-coverflow#readme"
}

0 comments on commit 968f66e

Please sign in to comment.