Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Commit

Permalink
Fix to get ember version from ember-source
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Apr 15, 2017
1 parent 3a09474 commit aec1803
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

# dependencies
/node_modules
/bower_components

# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
Expand Down
5 changes: 0 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
/bower_components
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.editorconfig
.ember-cli
.gitignore
.eslintrc.js
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
/.idea
Expand Down
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
language: node_js
node_js:
- "4"
- "6"

sudo: false

Expand All @@ -13,13 +13,10 @@ before_install:
- npm config set spin false
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add bower
- yarn --version
- bower --version

install:
- yarn install
- bower install

script:
- yarn run nodetest
Expand Down
13 changes: 13 additions & 0 deletions fastboot-tests/fixtures/second/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
}
};
2 changes: 1 addition & 1 deletion fastboot-tests/second-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const setupTest = require('../lib/tests/setup');
describe('second', function() {
setupTest('second', {
installPackages: {
'ember-bootstrap': 'kaliber5/ember-bootstrap#master' // @todo replace with release
'ember-bootstrap': '1.0.0-alpha.10'
}
});

Expand Down
3 changes: 1 addition & 2 deletions lib/util/app-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class AppManager {
return app.run('npm', 'install')
.then(() => {
// run default blueprints of installed packages
return RSVP.all(Object.keys(packages).map((pkgName) => app.runEmberCommand('generate', pkgName)))
.catch(() => {});
return RSVP.all(Object.keys(packages).map((pkgName) => app.runEmberCommand('generate', pkgName).catch(() => {})));
});
})
.then(function() {
Expand Down
22 changes: 21 additions & 1 deletion lib/util/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,33 @@
const fs = require('fs-extra');
const path = require('path');

function readAddonEmberVersion() {
function readAddonEmberVersionFromBower() {
let bowerJSONPath = path.join(findAddonPath(), 'bower.json');
let bowerJSON = fs.readJsonSync(bowerJSONPath);

return bowerJSON.dependencies['ember'];
}

function readAddonEmberVersionFromNpm() {
let packageJSONPath = path.join(findAddonPath(), 'package.json');
let packageJSON = fs.readJsonSync(packageJSONPath);

return packageJSON.devDependencies['ember-source'] || packageJSON.dependencies['ember-source'];
}

function readAddonEmberVersion() {
let emberVersion;
try {
emberVersion = readAddonEmberVersionFromNpm();
if (!emberVersion) {
emberVersion = readAddonEmberVersionFromBower();
}
}
catch (e) {}

return emberVersion;
}

function findAddonPath() {
return process.cwd();
}
Expand Down

0 comments on commit aec1803

Please sign in to comment.