fix #3 by reloading metadata prior to each build

This commit is contained in:
AJ ONeal 2015-01-21 02:41:12 -07:00
parent a73ea68402
commit e3a24e9652
1 changed files with 34 additions and 28 deletions

View File

@ -17,7 +17,9 @@ angular.module('myApp.build', ['ngRoute'])
;
function init() {
DesiraeService.meta().then(function (desi) {
scope.extensions = ['md', 'html'];
return DesiraeService.meta().then(function (desi) {
scope.blogdir = desi.blogdir.path.replace(/^\/(Users|home)\/[^\/]+\//, '~/');
scope.site = desi.site;
@ -30,13 +32,13 @@ angular.module('myApp.build', ['ngRoute'])
// this is the responsibility of the build system (Dear Desi), not the library (Desirae)
scope.development_url = location.href.replace(/\/(#.*)?$/, '') + path.join('/', 'compiled_dev');
return desi;
}).catch(function (e) {
window.alert("An Error Occured. Most errors that occur in the init phase are parse errors in the config files or permissions errors on files or directories, but check the error console for details.");
console.error(e);
throw e;
});
scope.extensions = ['md', 'html'];
}
scope.onError = function (e) {
@ -49,6 +51,8 @@ angular.module('myApp.build', ['ngRoute'])
};
scope.buildOne = function (envstr) {
return DesiraeService.reset().then(function () {
return init().then(function () {
var env
;
@ -77,6 +81,8 @@ angular.module('myApp.build', ['ngRoute'])
return DesiraeService.build(env).then(function () {
DesiraeService.write(env);
});
});
});
};
scope.build = function (envs) {