Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 6c0bbcc0d94a6b661db081341dc8d3247289e986 @kennethormandy kennethormandy committed Oct 29, 2015
Showing with 129 additions and 0 deletions.
  1. +18 −0 .gitignore
  2. +20 −0 LICENSE.md
  3. +9 −0 README.md
  4. +11 −0 gulpfile.js
  5. +32 −0 index.js
  6. +18 −0 package.json
  7. +21 −0 test/test.js
@@ -0,0 +1,18 @@
+# OS
+.DS_Store
+
+# Logs
+logs
+*.log*
+
+# Compiled binary addons (http://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directory
+node_modules
+components
+bower_components
+
+# Compile directories
+www/
+build/
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright © 2015 [Chloi Inc.](http://chloi.io)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the “Software”), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,9 @@
+# Gulp Surge
+
+The Gulp plugin for [Surge](https://surge.sh).
+
+## License
+
+[The MIT License (MIT)](LICENSE.md)
+
+Copyright © 2015 [Chloi](http://chloi.io)
@@ -0,0 +1,11 @@
+var gulp = require('gulp')
+var surge = require('./')
+
+gulp.task('default', ['deploy'])
+
+gulp.task('deploy', [], function () {
+ return surge({
+ project: './www',
+ domain: 'gulp-test-11.surge.sh'
+ })
+})
@@ -0,0 +1,32 @@
+var gulp = require('gulp')
+var spawn = require('child_process').spawn
+var gutil = require('gulp-util')
+var path = require('path')
+// var surge = require('surge')
+var surgeBin = path.resolve(path.dirname(require.resolve('surge')), '../../.bin/surge' + (process.platform === 'win32' ? '.cmd' : ''))
+
+module.exports = function(options) {
+
+ // Merge the default options with task specific ones
+ // var opts = options({
+ // project: '',
+ // domain: ''
+ // })
+
+ var surge = spawn(surgeBin, [options.project, options.domain])
+
+ surge.stdout.on('data', function (data) {
+ console.log(data + '')
+ })
+
+ surge.stderr.on('data', function (data) {
+ gutil.log('stderr: ' + data)
+ })
+
+ surge.on('close', function (code) {
+ if (code !== 0) {
+ gutil.log('process exited with code ' + code)
+ }
+ })
+
+}
@@ -0,0 +1,18 @@
+{
+ "name": "gulp-surge",
+ "version": "0.1.0",
+ "description": "",
+ "repository": "https://github.com/chloi/gulp-surge",
+ "dependencies": {
+ "gulp-util": "3.0.2",
+ "surge": "0.17.1"
+ },
+ "devDependencies": {
+ "chai": "1.10.0",
+ "mocha": "2.3.3",
+ "standard": "5.3.1"
+ },
+ "scripts": {
+ "test": "mocha test"
+ }
+}
@@ -0,0 +1,21 @@
+var fs = require('fs')
+var chai = require('chai')
+var es = require('event-stream')
+var gutil = require('gulp-util')
+var surge = require('../')
+var expect = chai.expect
+
+describe('gulp-surge', function () {
+ this.timeout(10000)
+
+ describe('basic', function () {
+
+ it('should be cool', function (done) {
+ done()
+ })
+
+ it('should publish a project', function (done) {
+
+ })
+ })
+})

0 comments on commit 6c0bbcc

Please sign in to comment.