-
Notifications
You must be signed in to change notification settings - Fork 144
/
gulpfile.js
32 lines (29 loc) · 1.06 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const gulp = require('gulp');
const prompt = require('gulp-prompt');
gulp.task('build-fusion-url', async () => {
gulp.src('./package.json').pipe(
prompt.prompt(
{
type: 'input',
name: 'task',
message: "Check oneNote for possible query parameters.\nProvide comma separated fusion query parameters (omit 'appsvc.'):",
},
function(res) {
if (res && res.task) {
const parameters = res.task.split(',');
let queryString = '';
parameters.forEach(parameter => {
const parts = parameter.split('=');
if (parts && parts.length === 2) {
const [key, value] = parts;
const query = queryString ? `%7Cappsvc.${key}%3D${value}` : `appsvc.${key}%3D${value}`;
queryString += query;
}
});
console.log(`Full URL - https://portal.azure.com?websitesextension_ext=${queryString}`);
console.log(`Query - websitesextension_ext=${queryString}`);
}
}
)
);
});