diff --git a/bin/build.js b/bin/build.js
index 88fd7b6..7287629 100644
--- a/bin/build.js
+++ b/bin/build.js
@@ -215,6 +215,27 @@ module.exports = function ( program ) {
styleContent = fs.readFileSync(styleFile);
break;
+ case 'swig':
+
+ console.log(' Setting view template to '.white + 'Swig'.blue);
+
+ pkg.dependencies['swig'] = 'latest';
+ scriptTemplate = '' + "\n";
+ styleTemplate = ' ' + "\n";
+
+ data = data.replace(new RegExp('html : \'jade\'', 'g'), 'html: \'swig\'');
+ wrench.rmdirSyncRecursive(path + '/app/views');
+ wrench.copyDirSyncRecursive(__dirname + '/_src/lib/templates/views/swig', path + '/app/views/');
+
+ // UPDATE SCRIPT FILE
+ var scriptFile = path + '/app/views/_inc/footer.html',
+ scriptContent = fs.readFileSync(scriptFile);
+
+ // UPDATE STYLE FILE
+ var styleFile = path + '/app/views/_inc/header.html',
+ styleContent = fs.readFileSync(styleFile);
+
+ break;
default:
diff --git a/bin/tesla b/bin/tesla
index 170dc1d..beb010c 100755
--- a/bin/tesla
+++ b/bin/tesla
@@ -20,7 +20,7 @@ var mkdirp = require('mkdirp'),
program
.version(version)
.usage('[options] [dir]')
- .option('-H, --html ', 'set html teplating engine: ejs|hjs|jshtml}hogan|jade (default)')
+ .option('-H, --html ', 'set html teplating engine: ejs|hjs|jshtml}hogan|swig|jade (default)')
.option('-C, --css ', 'add stylesheet support (less|stylus) (defaults to plain css)')
.option('-F, --force', 'force on non-empty directory')
.option('start', 'start the web server (still a bit buggy, best just just run "grunt" or "gulp" for now)')
@@ -62,6 +62,7 @@ if ( program.html === 'ejs' ) program.template = 'ejs'; // EJS
if ( program.html === 'hogan' ) program.template = 'hogan'; // HOGAN
if ( program.html === 'handlebars' ) program.template = 'handlebars'; // HANDLEBARS
if ( program.html === 'mustache' ) program.template = 'mustache'; // MUSTACHE
+if ( program.html === 'swig' ) program.template = 'swig'; // swig
// SCAFFOLDING FOR MODELS/CONTROLLERS
@@ -271,6 +272,19 @@ if (program.install) {
// UPDATE STYLE FILE
var styleFile = path + '/app/views/_inc/header.mustache',
styleContent = fs.readFileSync(styleFile);
+ } else if ( fs.existsSync(path + '/app/views/index.html') ) {
+
+ viewType = 'swig';
+ scriptTemplate = '' + "\n";
+ styleTemplate = ' ' + "\n";
+
+ // UPDATE SCRIPT FILE
+ var scriptFile = path + '/app/views/_inc/footer.html',
+ scriptContent = fs.readFileSync(scriptFile);
+
+ // UPDATE STYLE FILE
+ var styleFile = path + '/app/views/_inc/header.html',
+ styleContent = fs.readFileSync(styleFile);
}
diff --git a/package.json b/package.json
index f6d7de2..90bc424 100755
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
],
"repository": {
"type": "git",
- "url": "https://github.com/teslajs/tesla-cli"
+ "url": "https://github.com/captainhurst/tesla-cli"
},
"bugs": {
"url": "https://github.com/teslajs/tesla-cli/issues"