Permalink
Browse files

Make init work w/o requiring nonexistent config.js

  • Loading branch information...
1 parent 9dbd236 commit dcbd81822ca5ed0f37cd69b47664946acaea4bb0 @robogeek robogeek committed Jan 4, 2013
Showing with 12 additions and 7 deletions.
  1. +11 −6 cli.js
  2. +1 −1 package.json
View
@@ -32,9 +32,6 @@ var program = require('commander');
var akasha = require('akashacms');
var staticSrv = require('node-static');
-
-var config = require(process.cwd() + '/config.js');
-
program
.version('0.0.1')
// .option('-C, --chdir <path>', 'change the working directory')
@@ -63,12 +60,16 @@ program
program
.command('build')
.description('build an akashacms site in the current directory')
- .action(function() { akasha.process(config); });
+ .action(function() {
+ var config = require(process.cwd() + '/config.js');
+ akasha.process(config);
+ });
program
.command('deploy')
.description('Deploy the akashacms site using configuration file')
.action(function() {
+ var config = require(process.cwd() + '/config.js');
if (config.deploy_rsync) {
var user = config.deploy_rsync.user;
var host = config.deploy_rsync.host;
@@ -83,12 +84,16 @@ program
program
.command('minimize')
.description('Minimize the rendered akashacms site')
- .action(function() { akasha.minimize(config); });
+ .action(function() {
+ var config = require(process.cwd() + '/config.js');
+ akasha.minimize(config);
+ });
program
.command('serve')
.description('start a webserver')
- .action(function(){
+ .action(function() {
+ var config = require(process.cwd() + '/config.js');
var site = require(process.cwd() + '/config.js');
var fileServer = new staticSrv.Server(site.root_out);
http.createServer(function (request, response) {
View
@@ -14,7 +14,7 @@
"bin": {
"akashacms": "cli.js"
},
- "version": "0.2.2",
+ "version": "0.2.3",
"engines": {
"node": ">=0.8.1"
},

0 comments on commit dcbd818

Please sign in to comment.