Skip to content

Commit

Permalink
Moved readme.txt and integrated into gulpfile
Browse files Browse the repository at this point in the history
Implmented removing of folders and images removed from the filesystem (and associated caches files) - closes #7
Tidied gulpfile main tasks list
Added message for start of scanning as a workaround to issue #19
Reimplemented status messages to be a little more information full
Fixed glob for delCacheFiles function (wasn't removing "extension")
  • Loading branch information
bytesnz committed May 1, 2015
1 parent 6cd5b8d commit 1eeeda6
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 80 deletions.
57 changes: 39 additions & 18 deletions src/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var paths = {
int: ['readme.txt', 'README.md', 'LICENSE', 'lib/GHierarchy.php', 'lib/GHAlbum.php', 'lib/utils.php'],
albumsSrc: 'albums/*.php',
main: 'gallery-hierarchy.php',
readme: 'readme.txt',
//jsSrc: '{js/ghierarchy.js,albums/js/*.js}',
jsSrc: ['js/ghierarchy.js', 'albums/js/*.js'],
cssSrc: 'css/{jquery.plupload.queue.css,ghierarchy.less}',
Expand Down Expand Up @@ -114,21 +115,39 @@ gulp.task('clean', [], function() {
});

gulp.task('markupMainPhp', [], function() {
return gulp.src(paths.main)
.pipe(insert.prepend('<?php\n/**\n'
+ 'Plugin Name: ' + package.title + '\n'
+ 'Plugin URI: ' + package.homepage + '\n'
+ 'Version: ' + package.version + '\n'
+ 'Description: ' + package.description + '\n'
+ 'Author: ' + package.author.name + '\n'
+ 'Author URI: ' + package.author.url + '\n'
+ 'Text Domain: gallery-hierarchy\n'
+ 'Tags: ' + package.keywords.join(',') + '\n'
+ 'Licence: ' + package.licence + '\n'
+ '*/\n?>\n'
))
.pipe(gulp.dest(paths.dist));
});
return gulp.src(paths.main)
.pipe(insert.prepend('<?php\n/**\n'
+ 'Plugin Name: ' + package.title + '\n'
+ 'Plugin URI: ' + package.homepage + '\n'
+ 'Version: ' + package.version + '\n'
+ 'Description: ' + package.description + '\n'
+ 'Author: ' + package.author.name + '\n'
+ 'Author URI: ' + package.author.url + '\n'
+ 'Text Domain: gallery-hierarchy\n'
+ 'Tags: ' + package.keywords.join(',') + '\n'
+ 'Licence: ' + package.licence + '\n'
+ '*/\n?>\n'
))
.pipe(gulp.dest(paths.dist));
});

gulp.task('readme', [], function() {
return gulp.src(paths.readme)
.pipe(insert.prepend('=== ' + package.title + ' ===\n'
+ 'Contributors: weldstudio\n'
+ 'Donate link: http://gift.meldce.com\n'
+ 'Link: ' + package.homepage + '\n'
+ 'Tags: ' + package.keywords.join(', ') + '\n'
+ 'Requires at least: 3.8.0\n'
+ 'Tested up to: 3.9.2\n'
+ 'Stable tag: 0.2.0\n'
+ 'License: ' + package.licence + '\n'
+ 'License URI: http://www.gnu.org/licenses/gpl-2.0.html\n'
+ '\n'
+ package.description + '\n'
))
.pipe(gulp.dest(paths.dist));
});

gulp.task('auto-reload', function() {
var process;
Expand Down Expand Up @@ -241,7 +260,9 @@ gulp.task('watch', function() {
}
});

gulp.task('package', ['markupMainPhp', 'css', 'js', 'intFiles', 'albumFiles', 'basicStyle'].concat(Object.keys(paths.ext)), function() {
var defaultTasks = ['readme', 'markupMainPhp', 'css', 'js', 'intFiles', 'albumFiles', 'basicStyle'].concat(Object.keys(paths.ext));

gulp.task('package', defaultTasks, function() {
// removed $lp lines
var file = path.join(paths.dist, 'lib/GHierarchy.php');

Expand All @@ -264,9 +285,9 @@ gulp.task('package', ['markupMainPhp', 'css', 'js', 'intFiles', 'albumFiles', 'b
shell.task('cd .. && pwd');
});

gulp.task('one', ['markupMainPhp', 'css', 'js', 'intFiles', 'albumFiles', 'basicStyle'].concat(Object.keys(paths.ext)));
gulp.task('one', defaultTasks);

gulp.task('default', ['markupMainPhp', 'css', 'js', 'intFiles', 'albumFiles', 'basicStyle', 'watch'].concat(Object.keys(paths.ext)));
gulp.task('default', defaultTasks.concat(['watch']));

gulp.task('pre_production', [], function() {
delete paths.ext.lightbox;
Expand Down
3 changes: 3 additions & 0 deletions src/js/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function sendScanCommand(cmd, data) {
data = {};
}
data.a = cmd;

scanner.status.html('Starting scan... If this message doesn\'t change '
+ 'you may need to refresh the page.');
$.post(ajaxurl + '?action=gh_scan', data, receiveScanRefresh);
}

Expand Down
Loading

0 comments on commit 1eeeda6

Please sign in to comment.