ember-cli-update
Advanced tools
Comparing version 0.2.3 to 0.3.0
@@ -9,11 +9,10 @@ #!/usr/bin/env node | ||
.options(args) | ||
.version() | ||
.help() | ||
.argv; | ||
const distTag = argv['dist-tag']; | ||
const version = argv['version']; | ||
const to = argv['to']; | ||
emberCliUpdate({ | ||
distTag, | ||
version | ||
to | ||
}); |
{ | ||
"name": "ember-cli-update", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"description": "Update Ember CLI Ember.js apps and addons", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,1 +9,37 @@ # ember-cli-update | ||
Update Ember CLI Ember.js apps and addons | ||
## Installation | ||
As a global executable: | ||
`npm install -g ember-cli-update` | ||
As an Ember CLI command: | ||
`ember install ember-cli-update` | ||
## Usage | ||
Inside your project directory, either run | ||
`ember-cli-update` | ||
for global or | ||
`ember update` | ||
as an Ember CLI command. | ||
This will update your app or addon to the latest Ember CLI version. It does this by grabbing your current installed Ember CLI version and looking up the latest version, then applying a diff of the changes to your project. You will probably encounter merge conflicts, in which your system's git merge tool will run. | ||
## Options | ||
| Option | Description | Examples | Default | | ||
|---|---|---|---| | ||
| --to | Update to a version that isn\'t latest | "2.14.1" "latest" "beta" | latest | | ||
## Hints | ||
If you notice ".orig" files lying around after a merge and don't want that behavior, run `git config mergetool.keepBackup false`. | ||
To avoid being prompted "Hit return to start merge resolution tool (vimdiff):" for every conflict, set a merge tool like `git config merge.tool "vimdiff"`. |
module.exports = { | ||
'dist-tag': { | ||
'to': { | ||
type: 'string', | ||
default: 'latest', | ||
description: 'Update via dist-tag ("latest", "beta", etc...)' | ||
}, | ||
'version': { | ||
alias: ['v'], | ||
type: 'string', | ||
description: 'Update to a version that isn\'t latest' | ||
description: 'Update to a version that isn\'t latest ("2.14.1", latest", "beta")' | ||
} | ||
}; |
@@ -13,12 +13,6 @@ 'use strict'; | ||
{ | ||
name: 'dist-tag', | ||
description: args['dist-tag'].description, | ||
name: 'to', | ||
description: args['to'].description, | ||
type: String, | ||
default: args['dist-tag'].default | ||
}, | ||
{ | ||
name: 'version', | ||
description: args['version'].description, | ||
type: String, | ||
aliases: args['version'].alias | ||
default: args['to'].default | ||
} | ||
@@ -25,0 +19,0 @@ ], |
@@ -5,3 +5,16 @@ 'use strict'; | ||
module.exports = function getTagVersion(version, distTag) { | ||
const distTags = [ | ||
'latest', | ||
'beta' | ||
]; | ||
module.exports = function getTagVersion(to) { | ||
let distTag; | ||
let version; | ||
if (distTags.indexOf(to) > -1) { | ||
distTag = to; | ||
} else { | ||
version = to; | ||
} | ||
if (!version) { | ||
@@ -8,0 +21,0 @@ version = JSON.parse( |
@@ -10,4 +10,3 @@ 'use strict'; | ||
module.exports = function emberCliUpdate(options) { | ||
let distTag = options.distTag; | ||
let version = options.version; | ||
let to = options.to; | ||
@@ -19,3 +18,3 @@ let packageVersion = getPackageVersion('.'); | ||
let endTag = getTagVersion(version, distTag); | ||
let endTag = getTagVersion(to); | ||
@@ -22,0 +21,0 @@ let projectType = getProjectType('.'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7763
45
126