changelog-view
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -7,2 +7,10 @@ # Changelog | ||
## [1.6.0] - 2018-04-05 | ||
### Changed | ||
* add `--verbose` option to display debug informations | ||
## [1.5.1] - 2018-04-02 | ||
### Changed | ||
* Update README.md file to match current version | ||
## [1.5.0] - 2018-03-16 | ||
@@ -9,0 +17,0 @@ ### Changed |
{ | ||
"name": "changelog-view", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "Tool to view changelog of package in console", | ||
@@ -5,0 +5,0 @@ "bin": { |
// #!/usr/bin/env node | ||
import 'babel-polyfill'; | ||
import minimist from 'minimist'; | ||
import logger from './logger'; | ||
import packageListChangeLog from './'; | ||
@@ -12,2 +13,3 @@ | ||
help: 'h', | ||
verbose: 'v', | ||
}, | ||
@@ -28,2 +30,3 @@ }); | ||
log(' -h, --help Display this usage info'); | ||
log(' -v, --verbose Display debug informations'); | ||
process.exit(args.help ? 0 : 1); | ||
@@ -35,3 +38,6 @@ } else { | ||
function go(args) { | ||
if (args.verbose) { | ||
logger.setLogLevel(args.verbose); | ||
} | ||
packageListChangeLog(args._); | ||
} |
@@ -7,2 +7,3 @@ import https from 'https'; | ||
import { extractNextLink } from './github-tools'; | ||
import logger from './logger'; | ||
@@ -40,9 +41,14 @@ const TEST_PROCESSES = [ | ||
export async function getPackageData(packageName, gtThanVersion = null) { | ||
logger.log(`Package: ${packageName}, current version: ${gtThanVersion}`); | ||
for (let i = 0; i < TEST_PROCESSES.length; i++) { | ||
const fileToTest = TEST_PROCESSES[i]; | ||
logger.log('testing file:', fileToTest); | ||
try { | ||
switch (fileToTest.type) { | ||
case 'github-file': | ||
const url = `https://raw.githubusercontent.com/${packageName}/master/${fileToTest.fileName}`; | ||
const url = `https://raw.githubusercontent.com/${packageName}/master/${ | ||
fileToTest.fileName | ||
}`; | ||
const ghFileResult = await innerFetch(url); | ||
@@ -68,3 +74,5 @@ | ||
default: | ||
const msg = `Unable to determine file type to test: "${fileToTest.type}"`; | ||
const msg = `Unable to determine file type to test: "${ | ||
fileToTest.type | ||
}"`; | ||
throw new Error(msg); | ||
@@ -99,3 +107,10 @@ break; | ||
.then(versionList => { | ||
return filterVersionList(versionList, gtThanVersion); | ||
const filteredVersionList = filterVersionList(versionList, gtThanVersion); | ||
logger.log( | ||
`found ${ | ||
filteredVersionList.length | ||
} versions greater than "${gtThanVersion}" for package "${packageName}"` | ||
); | ||
return filteredVersionList; | ||
}); | ||
@@ -102,0 +117,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2436
1649100