var gulp = require('gulp');
var run = require('gulp-run');
var connect = require('gulp-connect');
var path = require('path');
var stylus = require('gulp-stylus');
var nib = require('nib');

gulp.task('connect', function() {
  connect.server();
});

gulp.task('stylus', function() {
  gulp.src('./css/styl.styl')
    .pipe(stylus({
      use: [nib()]
    }))
    .pipe(gulp.dest('./css'));
})

gulp.task('watch', function() {
  gulp.watch('./css/style.styl', ['stylus']);
});

gulp.task('default', ['connect', 'watch']);

var build_files = [
  'css/**/*.*',
  'data/**/*.*',
  'img/**/*.*',
  'js/**/*.*',
  'index.html'
];

gulp.task('build', function() {
  gulp.src(build_files, {
    base: './'
  })
    .pipe(gulp.dest('build'));
});

gulp.task('upload', function() {
  run('aws s3 cp build s3://labs.floored.com/buildings --recursive').exec();
});

gulp.task('publish', ['build', 'upload']);
var gulp = require('gulp');
var run = require('gulp-run');
var connect = require('gulp-connect');
var path = require('path');
var stylus = require('gulp-stylus');
var nib = require('nib');

gulp.task('connect', function() {
  connect.server();
});

gulp.task('stylus', function() {
  gulp.src('./css/styl.styl')
    .pipe(stylus({
      use: [nib()]
    }))
    .pipe(gulp.dest('./css'));
})

gulp.task('watch', function() {
  gulp.watch('./css/*.styl', ['stylus']);
});

gulp.task('default', ['connect', 'watch']);

var build_files = [
  'css/**/*.*',
  'data/**/*.*',
  'img/**/*.*',
  'js/**/*.*',
  'index.html'
];

gulp.task('build', function() {
  gulp.src(build_files, {
    base: './'
  })
    .pipe(gulp.dest('build'));
});

gulp.task('upload', function() {
  run('aws s3 cp build s3://labs.floored.com/buildings --recursive').exec();
});

gulp.task('publish', ['build', 'upload']);
watch all styl files