Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
fix(index.js): generate it with bare option
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed Jan 11, 2014
1 parent 7ebc8d5 commit 8509560
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 37 deletions.
11 changes: 8 additions & 3 deletions .npmignore
Expand Up @@ -11,6 +11,11 @@ pids
logs
results

npm-debug.log
node_modules
*.sublime*
*.sublime*

example
src
test

.travis.yml
gulpfile.ls
2 changes: 1 addition & 1 deletion gulpfile.ls
Expand Up @@ -12,7 +12,7 @@ require! {
gulp.task 'build' ->
const index = do
gulp.src 'src/index.ls'
.pipe gulp-livescript!
.pipe gulp-livescript bare: true
.pipe gulp.dest '.'

const main = do
Expand Down
64 changes: 31 additions & 33 deletions index.js
@@ -1,34 +1,32 @@
(function(){
var mapStream, LiveScript, gutil;
mapStream = require('map-stream');
LiveScript = require('LiveScript');
gutil = require('gulp-util');
module.exports = function(options){
options || (options = {});
function modifyLS(file, cb){
var done, error, e;
done = function(){
cb(void 8, file);
};
error = function(it){
cb(
new gutil.PluginError('gulp-livescript', it));
};
if (file.isNull()) {
return done();
}
if (file.isStream()) {
return error('Streaming not supported');
}
try {
file.contents = new Buffer(LiveScript.compile(file.contents.toString('utf8'), options));
file.path = gutil.replaceExtension(file.path, '.js');
} catch (e$) {
e = e$;
return error(e);
}
done();
var mapStream, LiveScript, gutil;
mapStream = require('map-stream');
LiveScript = require('LiveScript');
gutil = require('gulp-util');
module.exports = function(options){
options || (options = {});
function modifyLS(file, cb){
var done, error, e;
done = function(){
cb(void 8, file);
};
error = function(it){
cb(
new gutil.PluginError('gulp-livescript', it));
};
if (file.isNull()) {
return done();
}
return mapStream(modifyLS);
};
}).call(this);
if (file.isStream()) {
return error('Streaming not supported');
}
try {
file.contents = new Buffer(LiveScript.compile(file.contents.toString('utf8'), options));
file.path = gutil.replaceExtension(file.path, '.js');
} catch (e$) {
e = e$;
return error(e);
}
done();
}
return mapStream(modifyLS);
};

0 comments on commit 8509560

Please sign in to comment.