Skip to content

Commit

Permalink
Merge pull request #3 from HugoCapocci/feature/handle-package-renaming
Browse files Browse the repository at this point in the history
take use of aliases into account
  • Loading branch information
HugoCapocci authored May 28, 2017
2 parents 6d06e38 + 8b3f3f3 commit 942e8fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
6 changes: 6 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deployment:
npm:
branch: master
commands:
- echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login
- npm publish
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down
19 changes: 15 additions & 4 deletions src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand All @@ -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
Expand Down

0 comments on commit 942e8fa

Please sign in to comment.