File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
import fs from 'fs' ;
2
2
import rp from 'request-promise' ;
3
3
import Q from 'q' ;
4
+ import { ok } from 'assert' ;
4
5
5
6
// TODO: Change branchName if necessary
6
7
const branchName = 'release' ;
@@ -10,10 +11,17 @@ const clientId = process.env.GITHUB_ID;
10
11
const clientSecret = process . env . GITHUB_SECRET ;
11
12
const editorUsername = process . env . ML5_EXAMPLES_USERNAME ;
12
13
const personalAccessToken = process . env . EDITOR_API_ACCESS_TOKEN ;
14
+ const editorApiUrl = process . env . EDITOR_API_URL ;
13
15
const headers = {
14
16
'User-Agent' : 'p5js-web-editor/0.0.1'
15
17
} ;
16
18
19
+ ok ( clientId , 'GITHUB_ID is required' ) ;
20
+ ok ( clientSecret , 'GITHUB_SECRET is required' ) ;
21
+ ok ( editorUsername , 'ML5_EXAMPLES_USERNAME is required' ) ;
22
+ ok ( personalAccessToken , 'EDITOR_API_ACCESS_TOKEN is required' ) ;
23
+ ok ( editorApiUrl , 'EDITOR_API_URL is required' ) ;
24
+
17
25
//
18
26
const githubRequestOptions = {
19
27
url : baseUrl ,
@@ -27,7 +35,7 @@ const githubRequestOptions = {
27
35
} ;
28
36
29
37
const editorRequestOptions = {
30
- url : `${ process . env . P5_API || 'http://localhost:8000/api' } /${ editorUsername } ` ,
38
+ url : `${ editorApiUrl } /${ editorUsername } ` ,
31
39
method : 'GET' ,
32
40
headers : {
33
41
...headers ,
You can’t perform that action at this time.
0 commit comments