The last step to upgrade an ember-cli app, after you type ember init
, I found a new option edit that allow you to edit a diff patch directly, “Great!” I thought at first…until I encounter an error message again and again, it says:
Patch was not cleanly applied. Please choose another action.
Okay, copy that, but how am I suppose to patch it cleanly? For example, I started with a patch file like this:
Index: /Users/nightire/code/dearann/client/app/app.js
===================================================================
--- /Users/nightire/code/dearann/client/app/app.js
+++ /Users/nightire/code/dearann/client/app/app.js
@@ -1,17 +1,16 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
+import config from './config/environment';
Ember.MODEL_FACTORY_INJECTIONS = true;
var App = Ember.Application.extend({
+ modulePrefix: config.modulePrefix,
+ podModulePrefix: config.podModulePrefix,
+ Resolver: Resolver
- modulePrefix: 'dearann', // TODO: loaded via config
- Resolver: Resolver,
- ready: function () {
- moment.locale('zh-cn');
- }
});
+loadInitializers(App, config.modulePrefix);
-loadInitializers(App, 'dearann');
export default App;
and change to this (use vim) :
Index: /Users/nightire/code/dearann/client/app/app.js
===================================================================
--- /Users/nightire/code/dearann/client/app/app.js
+++ /Users/nightire/code/dearann/client/app/app.js
@@ -1,17 +1,16 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import config from './config/environment';
import loadInitializers from 'ember/load-initializers';
Ember.MODEL_FACTORY_INJECTIONS = true;
var App = Ember.Application.extend({
Resolver: Resolver,
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
ready: function () {
moment.locale('zh-cn');
}
});
loadInitializers(App, config.modulePrefix);
export default App;
Save and exit, then I think it should be work enough, but still “was not cleanly” even after I delete the first five lines as well, that drives me crazy!
Is there anyone who can manage this correctly? I would appreciate it someone can show me a screencast or short GIF demonstration, thanks in advance.