Skip to content

Commit cd27559

Browse files
author
Eric Koleda
committed
Fix distributable library and change build scripts slightly. Fixes issue #46.
1 parent 02ef999 commit cd27559

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

dist/OAuth2.gs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* any required setup.
2222
*/
2323

24-
// Load the Underscore.js library. This library was added using the project
25-
// key "MGwgKN2Th03tJ5OdmlzB8KPxhMjh3Sh48".
24+
// Load the Underscore.js library. This library was added using the script
25+
// ID "1I21uLOwDKdyF3_W_hvh6WXiIKWJWno8yG9lB8lf1VBnZFQ6jAAhyNTRG".
2626

2727

2828
/**
@@ -65,6 +65,13 @@ function getRedirectUri(scriptId) {
6565
return Utilities.formatString('https://script.google.com/macros/d/%s/usercallback', scriptId);
6666
}
6767

68+
if (module) {
69+
module.exports = {
70+
createService: createService,
71+
getRedirectUri: getRedirectUri
72+
};
73+
}
74+
6875
// Copyright 2014 Google Inc. All Rights Reserved.
6976
//
7077
// Licensed under the Apache License, Version 2.0 (the "License");

gulpfile.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,11 @@ var expose = require('gulp-expose');
44
var stripLine = require('gulp-strip-line');
55
var gulpif = require('gulp-if');
66
var del = require('del');
7-
var bump = require('gulp-bump');
87
var rename = require("gulp-rename");
98
var jshint = require('gulp-jshint');
109
var stylish = require('jshint-stylish');
1110

12-
gulp.task('release', ['clean', 'dist'], function() {
13-
gulp.src('./package.json')
14-
.pipe(bump({type:'minor'}))
15-
.pipe(gulp.dest('./'));
16-
})
17-
18-
gulp.task('dist', function() {
11+
gulp.task('dist', ['clean'], function() {
1912
gulp.src('src/*.gs')
2013
.pipe(gulpif(/OAuth2\.gs$/,
2114
stripLine('var _ =')))

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@
2727
},
2828
"dependencies": {
2929
"underscore": "^1.8.3"
30+
},
31+
"scripts": {
32+
"postversion": "gulp dist",
33+
"dist": "gulp dist",
34+
"lint": "gulp lint"
3035
}
3136
}

src/OAuth2.gs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ function createService(serviceName) {
6060
function getRedirectUri(scriptId) {
6161
return Utilities.formatString('https://script.google.com/macros/d/%s/usercallback', scriptId);
6262
}
63+
64+
if (module) {
65+
module.exports = {
66+
createService: createService,
67+
getRedirectUri: getRedirectUri
68+
};
69+
}

0 commit comments

Comments
 (0)