Skip to content

Commit

Permalink
容错处理、修改bin
Browse files Browse the repository at this point in the history
  • Loading branch information
myhirra committed Jul 10, 2016
1 parent 29a8db2 commit 46c6c3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = function(keywords) {
var neteaseApi = require('NeteaseCloudMusicApi').api
neteaseApi.search(keywords, function(data) {
var songs = JSON.parse(data).result.songs;
if (songs.length) {
if (songs && songs.length) {
var neteaseLink = `http://music.163.com/#/song?id=${songs[0].id}`;
console.log('netease', neteaseLink);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "lib/index.js",
"bin": {
"find-music": "bin/find-music"
"find-music": "bin/find-music --keywords"
},
"scripts": {
"init": "npm install"
Expand Down

0 comments on commit 46c6c3e

Please sign in to comment.