Skip to content

Commit

Permalink
Source and target dir locating improved..
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Palounek committed Apr 25, 2012
1 parent 3892988 commit a1ab044
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.DS_Store
npm-debug.log
node_modules
node_modules
3 changes: 1 addition & 2 deletions bin/restatic
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

node ../src/restatic.js $1 $2 fetch
node ../src/restatic.js $1 $2 process
node ../src/restatic.js $1 $2 $3
3 changes: 0 additions & 3 deletions bin/restatic-fetch

This file was deleted.

3 changes: 0 additions & 3 deletions bin/restatic-process

This file was deleted.

8 changes: 4 additions & 4 deletions src/Environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Environment.prototype.loadExtractor = function (defaultExtractor) {
}

Environment.prototype.prepareEnvironment = function () {
if(Environment.conf.mode == 'process') {
if(Environment.conf.mode != 'fetch') {
if(Environment.conf.target == './_site/') {
var dirName = '/tmp/restatic_temp/';

Expand Down Expand Up @@ -95,7 +95,7 @@ Environment.prototype.prepareEnvironment = function () {

Environment.prototype.loadConfigFile = function (fileName) {
if(typeof Environment.conf.source != 'undefined') {
var contents = fs.readFileSync(Environment.conf.source + '/' + fileName);
var contents = fs.readFileSync(Environment.conf.source + fileName);
var config = JSON.parse(contents);
}

Expand All @@ -119,13 +119,13 @@ Environment.prototype.loadLineArgs = function (args) {

if(args[0] != '-d') {
if(typeof args[0] != 'undefined') {
Environment.conf.source = this.fixEndingSlash(args[0]);
Environment.conf.source = this.fixEndingSlash(path.resolve(args[0]));
} else {
checked = false;
}

if(typeof args[1] != 'undefined') {
Environment.conf.target = this.fixEndingSlash(args[1]);
Environment.conf.target = this.fixEndingSlash(path.resolve(args[1]));
} else {
checked = false;
}
Expand Down

0 comments on commit a1ab044

Please sign in to comment.