Merge pull request #12 from trecenti/npm_as_a_build_tool
[tech-radar.git] / scripts / publish-examples.js
diff --git a/scripts/publish-examples.js b/scripts/publish-examples.js
new file mode 100644 (file)
index 0000000..42dca3d
--- /dev/null
@@ -0,0 +1,15 @@
+var ghpages = require('gh-pages')
+  , path = require('path')
+  , options = {};
+
+options.logger = console.log.bind(this);
+
+function callback(err) {
+  if (err) {
+    console.error('Error publishing to gh-pages', err);
+  } else {
+    console.log('Successfully published to gh-pages');
+  }
+}
+
+ghpages.publish(path.join(__dirname, './examples'), options, callback);