Skip to content

Commit 0018f69

Browse files
committed
Removed local path from nsconfig
1 parent 461360b commit 0018f69

File tree

1 file changed

+22
-31
lines changed

1 file changed

+22
-31
lines changed

src/nscabinet.js

+22-31
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var request = require('request'),
66
through = require('through2'),
77
vinyl = require('vinyl'),
8-
nsconfig = require('../../nsconfig'),
8+
nsconfig = require('nsconfig'),
99
path = require('path');
1010

1111
var PARAMS_DEF = [
@@ -158,39 +158,30 @@ function _requestOpts (params) {
158158
server = process.env.NS_SERVER || `https://rest.${params.realm}/app/site/hosting/restlet.nl`;
159159
//NS_SERVER = testing + nsmockup
160160

161-
if (params.token) {
162-
163-
return {
164-
url: server,
165-
qs: {
166-
script: params.script,
167-
deploy: params.deployment
168-
},
169-
method: 'POST',
170-
oauth: {
171-
consumer_key: params.consumerKey,
172-
consumer_secret: params.consumerSecret,
173-
token: params.token,
174-
token_secret: params.tokenSecret,
175-
realm: params.account
176-
}
177-
};
161+
var options = {
162+
url: server,
163+
qs: {
164+
script: params.script,
165+
deploy: params.deployment
166+
},
167+
method: 'POST'
168+
};
178169

170+
if (params.token) {
171+
options.oauth = {
172+
consumer_key: params.consumerKey,
173+
consumer_secret: params.consumerSecret,
174+
token: params.token,
175+
token_secret: params.tokenSecret,
176+
realm: params.account
177+
}
179178
} else {
180-
181-
return {
182-
url: server,
183-
qs: {
184-
script: params.script,
185-
deploy: params.deployment
186-
},
187-
method : 'POST' ,
188-
headers: {
189-
authorization: `NLAuth nlauth_account=${params.account},nlauth_email=${params.email},nlauth_signature=${params.password}${nlauthRolePortion}`
190-
}
191-
};
192-
179+
options.headers = {
180+
authorization: `NLAuth nlauth_account=${params.account},nlauth_email=${params.email},nlauth_signature=${params.password}${nlauthRolePortion}`
181+
}
193182
}
183+
184+
return options;
194185
}
195186

196187

0 commit comments

Comments
 (0)