mirror of
https://github.com/lrsjng/jquery-qrcode.git
synced 2026-08-13 04:11:36 +08:00
Minor changes.
This commit is contained in:
+12
-11
@@ -6,7 +6,7 @@ var path = require('path'),
|
|||||||
child_process = require('child_process');
|
child_process = require('child_process');
|
||||||
|
|
||||||
|
|
||||||
var version = '0.3-dev',
|
var pkg = require('./package.json'),
|
||||||
|
|
||||||
root = path.resolve(__dirname),
|
root = path.resolve(__dirname),
|
||||||
src = path.resolve(root, 'src'),
|
src = path.resolve(root, 'src'),
|
||||||
@@ -56,18 +56,18 @@ module.exports = function (make) {
|
|||||||
stamp = moment();
|
stamp = moment();
|
||||||
|
|
||||||
replacements = {
|
replacements = {
|
||||||
version: version,
|
pkg: pkg,
|
||||||
stamp: stamp.format('YYYY-MM-DD HH:mm:ss')
|
stamp: stamp.format('YYYY-MM-DD HH:mm:ss')
|
||||||
};
|
};
|
||||||
|
|
||||||
Event.info({ method: 'before', message: version + ' ' + replacements.stamp });
|
Event.info({ method: 'before', message: pkg.version + ' ' + replacements.stamp });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
make.target('git-hash', [], 'get git hash tag')
|
make.target('git-hash', [], 'get git hash tag')
|
||||||
.async(function (done, fail) {
|
.async(function (done, fail) {
|
||||||
|
|
||||||
if (!/-dev$/.test(version)) {
|
if (!/-dev$/.test(pkg.version)) {
|
||||||
done();
|
done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -86,9 +86,8 @@ module.exports = function (make) {
|
|||||||
Event.error({ method: 'git-hash', message: cmd + ' exit code ' + code });
|
Event.error({ method: 'git-hash', message: cmd + ' exit code ' + code });
|
||||||
fail();
|
fail();
|
||||||
} else {
|
} else {
|
||||||
version += '-' + hash;
|
pkg.version += '-' + hash;
|
||||||
replacements.version = version;
|
Event.ok({ method: 'git-hash', message: 'version is now ' + pkg.version });
|
||||||
Event.ok({ method: 'git-hash', message: 'version is now ' + version });
|
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -113,12 +112,14 @@ module.exports = function (make) {
|
|||||||
make.target('build', ['git-hash'], 'build all updated files')
|
make.target('build', ['git-hash'], 'build all updated files')
|
||||||
.sync(function () {
|
.sync(function () {
|
||||||
|
|
||||||
$(src + ': jquery.qrcode.js')
|
var scriptName = pkg.name;
|
||||||
|
|
||||||
|
$(src + ': ' + scriptName + '.js')
|
||||||
.includify()
|
.includify()
|
||||||
.handlebars(replacements)
|
.handlebars(replacements)
|
||||||
.write($.OVERWRITE, path.join(build, 'jquery.qrcode-' + version + '.js'))
|
.write($.OVERWRITE, path.join(build, scriptName + '-' + pkg.version + '.js'))
|
||||||
.uglifyjs()
|
.uglifyjs()
|
||||||
.write($.OVERWRITE, path.join(build, 'jquery.qrcode-' + version + '.min.js'));
|
.write($.OVERWRITE, path.join(build, scriptName + '-' + pkg.version + '.min.js'));
|
||||||
|
|
||||||
$(root + ': README*, LICENSE*')
|
$(root + ': README*, LICENSE*')
|
||||||
.write($.OVERWRITE, mapperRoot);
|
.write($.OVERWRITE, mapperRoot);
|
||||||
@@ -128,7 +129,7 @@ module.exports = function (make) {
|
|||||||
make.target('release', ['clean', 'build'], 'create a zipball')
|
make.target('release', ['clean', 'build'], 'create a zipball')
|
||||||
.async(function (done, fail) {
|
.async(function (done, fail) {
|
||||||
|
|
||||||
var target = path.join(build, 'jquery.qrcode-' + version + '.zip'),
|
var target = path.join(build, pkg.name + '-' + pkg.version + '.zip'),
|
||||||
cmd = 'zip',
|
cmd = 'zip',
|
||||||
args = ['-ro', target, '.'],
|
args = ['-ro', target, '.'],
|
||||||
options = { cwd: build },
|
options = { cwd: build },
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "jquery.qrcode",
|
||||||
|
"displayName": "jQuery.qrcode",
|
||||||
|
"version": "0.3-dev"
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/*! jQuery.qrcode %BUILD_VERSION% - //larsjung.de/qrcode - MIT License */
|
/*! {{pkg.displayName}} {{pkg.version}} - //larsjung.de/qrcode - MIT License */
|
||||||
|
|
||||||
// Uses [QR Code Generator](http://www.d-project.com/qrcode/index.html) (MIT), appended to the end of this file.
|
// Uses [QR Code Generator](http://www.d-project.com/qrcode/index.html) (MIT), appended to the end of this file.
|
||||||
// Kudos to [jquery.qrcode.js](http://github.com/jeromeetienne/jquery-qrcode) (MIT).
|
// Kudos to [jquery.qrcode.js](http://github.com/jeromeetienne/jquery-qrcode) (MIT).
|
||||||
|
|||||||
Reference in New Issue
Block a user