fix #3 by reloading metadata prior to each build

Tento commit je obsažen v:
AJ ONeal 2015-01-21 02:41:12 -07:00
rodič a73ea68402
revize e3a24e9652

Zobrazit soubor

@ -17,7 +17,9 @@ angular.module('myApp.build', ['ngRoute'])
; ;
function init() { 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.blogdir = desi.blogdir.path.replace(/^\/(Users|home)\/[^\/]+\//, '~/');
scope.site = desi.site; 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) // this is the responsibility of the build system (Dear Desi), not the library (Desirae)
scope.development_url = location.href.replace(/\/(#.*)?$/, '') + path.join('/', 'compiled_dev'); scope.development_url = location.href.replace(/\/(#.*)?$/, '') + path.join('/', 'compiled_dev');
return desi;
}).catch(function (e) { }).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."); 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); console.error(e);
throw e; throw e;
}); });
scope.extensions = ['md', 'html'];
} }
scope.onError = function (e) { scope.onError = function (e) {
@ -49,6 +51,8 @@ angular.module('myApp.build', ['ngRoute'])
}; };
scope.buildOne = function (envstr) { scope.buildOne = function (envstr) {
return DesiraeService.reset().then(function () {
return init().then(function () {
var env var env
; ;
@ -77,6 +81,8 @@ angular.module('myApp.build', ['ngRoute'])
return DesiraeService.build(env).then(function () { return DesiraeService.build(env).then(function () {
DesiraeService.write(env); DesiraeService.write(env);
}); });
});
});
}; };
scope.build = function (envs) { scope.build = function (envs) {