Permalink
Browse files

Added sync action

  • Loading branch information...
1 parent 86992fd commit 3548505485569aef0b1667f33d7fed7a48527cf8 @DamonOehlman committed Jan 10, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 lib/actions/sync.js
View
34 lib/actions/sync.js
@@ -0,0 +1,34 @@
+var docstar = require('../docstar'),
+ events = require('events'),
+ debug = require('debug')('docstar'),
+ path = require('path'),
+ util = require('util');
+
+function _sync(docstar, scaffolder, callback) {
+ scaffolder.loadPackageData(function(err, data) {
+ if (! err) {
+ docstar.tweakConfig({
+ copyright: (new Date().getFullYear()) + ', ' + data.author,
+ project: data.name,
+ version: data.version
+ });
+ }
+
+ callback(err, data);
+ });
+};
+
+module.exports = function(opts, extraArgs, callback) {
+ var scaffolder = this;
+
+ docstar.init(opts, function(err, instance) {
+ if (err) {
+ scaffolder.out(err);
+ }
+ else {
+ _sync(instance, scaffolder, function() {
+
+ });
+ }
+ });
+};

0 comments on commit 3548505

Please sign in to comment.