flow-search
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -22,2 +22,3 @@ require('es6-promise').polyfill(); | ||
return search(argv.branch) | ||
.catch(console.error) | ||
.then(res => find(res, argv.d)) | ||
@@ -27,2 +28,2 @@ .then(console.log); | ||
return search(argv.branch).then(console.log); | ||
return search(argv.branch).then(console.log).catch(console.error); |
@@ -6,3 +6,3 @@ module.exports = (branch) => { | ||
if (branch !== 'master' && branch.match(/v\d{1,}\.\d{1,}/) === null) { | ||
throw new Error('branch name is invalid'); | ||
return Promise.reject(new Error('branch name is invalid')); | ||
} | ||
@@ -22,2 +22,4 @@ | ||
.then(res => res.map(item => item.download_url)) | ||
// 存在しない場合はエラーが返ってくる | ||
.catch(() => Promise.reject(new Error('branch does not exists'))) | ||
// テキストで全部取る | ||
@@ -24,0 +26,0 @@ .then(urls => Promise.all(urls.map(url => fetch(url).then(res => res.text())))) |
{ | ||
"name": "flow-search", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Search flow builtin types from your console.", | ||
@@ -5,0 +5,0 @@ "bin": { |
98254
83