forked from Azure/azure-functions-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (36 loc) · 1.31 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
33
34
35
36
37
38
39
40
const gulp = require('gulp');
const prompt = require('gulp-prompt');
const inlinesource = require('gulp-inline-source');
gulp.task('inline-react-code-coverage', async () => {
return gulp
.src('./client-react/coverage/**/*.html')
.pipe(inlinesource({ attribute: false }))
.pipe(gulp.dest('./coverage'));
});
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}`);
}
}
)
);
});