diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..e8bdbf9 --- /dev/null +++ b/circle.yml @@ -0,0 +1,6 @@ +deployment: + npm: + branch: master + commands: + - echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login + - npm publish diff --git a/package.json b/package.json index 6bac4c2..be28f83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bower-outdated", - "version": "0.0.7", + "version": "0.8.0", "description": "This command will check the bower registry to see if any (or, specific) installed packages are currently outdated", "license": "Apache-2.0", "engines": { @@ -20,7 +20,7 @@ "preferGlobal": true, "scripts": { "prepublish": "coffee -o lib -c src/index.coffee", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"no test specified\" && exit 0" }, "repository": { "type": "git", diff --git a/src/index.coffee b/src/index.coffee index fd49bba..3a4221a 100644 --- a/src/index.coffee +++ b/src/index.coffee @@ -43,9 +43,11 @@ checkInstalledVersions = -> Promise.map bowerDependencies, (bowerDependency) -> new Promise (resolve, reject) -> - fs.readFile src + '/' + bowerDependency.name + '/.bower.json', (error, data) -> - return reject error if error - bowerDependency.actualVersion = JSON.parse(data).version + name = if bowerDependency.installedName then bowerDependency.installedName else bowerDependency.name + file = src + '/' + name + '/.bower.json' + fs.readFile file, (error, data) -> + unless error + bowerDependency.actualVersion = JSON.parse(data).version resolve() ansiTrim = (str) -> @@ -69,8 +71,17 @@ makePretty = ({name, actualVersion, wantedVersion, latestVersion}) -> columns mapDependencyFromConfig = (value, key) -> + sharpIndex = value.indexOf '#' + if sharpIndex isnt -1 + if _.startsWith value, 'git' + value = 'git' + else + installedName = key + key = value.substring 0, sharpIndex + value = value.substring sharpIndex + 1 name: key - wantedVersion: if _.startsWith value, 'git' then 'git' else value + wantedVersion: value + installedName: installedName if installedName? bowerDependencies = _.map bowerConf.dependencies, mapDependencyFromConfig bowerDependencies = bowerDependencies.concat _.map bowerConf.devDependencies, mapDependencyFromConfig