Fix aiv log full issue due to no argv execution

This commit is contained in:
radswiat 2017-04-12 10:05:43 +01:00
parent a158b4075c
commit 04bc44a87a
5 changed files with 18 additions and 3 deletions

View file

@ -1,4 +1,4 @@
// [AIV] Build version: 0.5.1 // [AIV] Build version: 0.5.2
/******/ (function(modules) { // webpackBootstrap /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache /******/ // The module cache
/******/ var installedModules = {}; /******/ var installedModules = {};
@ -71,7 +71,7 @@
/* 0 */ /* 0 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
module.exports = "<!DOCTYPE html><html lang=en><head><meta charset=UTF-8><title>Title</title></head><body><span>My awesome project | 0.5.1></span></body></html>" module.exports = "<!DOCTYPE html><html lang=en><head><meta charset=UTF-8><title>Title</title></head><body><span>My awesome project | 0.5.2></span></body></html>"
/***/ }), /***/ }),
/* 1 */ /* 1 */

View file

@ -14,5 +14,8 @@
"html-minify-loader": "^1.1.0", "html-minify-loader": "^1.1.0",
"raw-loader": "^0.5.1", "raw-loader": "^0.5.1",
"webpack": "^2.3.3" "webpack": "^2.3.3"
},
"dependencies": {
"webpack-auto-inject-version": "^0.5.1"
} }
} }

View file

@ -273,6 +273,12 @@ var argv = __webpack_require__(18).argv;
* @returns {boolean} * @returns {boolean}
*/ */
function isArgv(arg) { function isArgv(arg) {
if (typeof argv.env === 'undefined') {
return false;
}
if (typeof argv.env[arg] === 'undefined') {
return false;
}
return Boolean(argv.env[arg]); return Boolean(argv.env[arg]);
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "webpack-auto-inject-version", "name": "webpack-auto-inject-version",
"version": "0.5.1", "version": "0.5.3",
"repository": "radswiat/webpack-auto-inject-version", "repository": "radswiat/webpack-auto-inject-version",
"description": "Webpack plugin for auto inject version from package.json", "description": "Webpack plugin for auto inject version from package.json",
"main": "dist/WebpackAutoInjectVersion.js", "main": "dist/WebpackAutoInjectVersion.js",

View file

@ -9,6 +9,12 @@ let argv = require('optimist').argv;
* @returns {boolean} * @returns {boolean}
*/ */
export function isArgv(arg) { export function isArgv(arg) {
if (typeof argv.env === 'undefined') {
return false;
}
if (typeof argv.env[arg] === 'undefined') {
return false;
}
return Boolean(argv.env[arg]); return Boolean(argv.env[arg]);
} }