-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get gulp file working for now, even if it's not exactly the best way …
…possible to say the least.
- Loading branch information
Showing
2 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,43 @@ | ||
const gulp = require('gulp'); | ||
const zip = require('gulp-zip'); | ||
//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'); | ||
const run = require('gulp-run'); | ||
|
||
|
||
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 = 'Koha/Plugin/Com/ByWaterSolutions/'; | ||
var pm_file_path_full = pm_file_path + pm_file; | ||
var pm_file_path_dist = 'dist/' + pm_file_path; | ||
var pm_file_path_full_dist = pm_file_path_dist + pm_file; | ||
|
||
console.log(release_filename); | ||
console.log(pm_file_path_full_dist); | ||
|
||
gulp.task('build', () => { | ||
// Set module version | ||
gulp.src(pm_file_path_full) | ||
.pipe(replace('{VERSION}', package_json.version)) | ||
.pipe(gulp.dest(pm_file_path)); | ||
run('mkdir dist ; cp -ar Koha dist/. ; cp -ar JavaScript dist/. ; sed -i -e "s/{VERSION}/' + package_json.version + '/g" ' + pm_file_path_full_dist + ' ; cd dist ; zip -r ../' + release_filename + ' ./Koha ./JavaScript ; cd .. ; rm -rf dist').exec(); | ||
|
||
//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()); | ||
})); | ||
}); | ||
|
||
/* | ||
// Set module version | ||
gulp.src(pm_file_path_full) | ||
.pipe(replace('{VERSION}', package_json.version)) | ||
.pipe(gulp.dest(pm_file_path_dist)); | ||
//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('./')); | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters