@tywalk/pcf-helper-run 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +13 -9
- package/package.json +5 -2
package/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const upgradeTask = require('
|
|
3
|
-
const buildTask = require('
|
|
4
|
-
const importTask = require('
|
|
2
|
+
const upgradeTask = require('@tywalk/pcf-helper/tasks/upgrade-pcf');
|
|
3
|
+
const buildTask = require('@tywalk/pcf-helper/tasks/build-pcf');
|
|
4
|
+
const importTask = require('@tywalk/pcf-helper/tasks/import-pcf');
|
|
5
5
|
const [, , ...args] = process.argv;
|
|
6
6
|
|
|
7
7
|
const commandArgument = args.at(0)?.toLowerCase();
|
|
8
8
|
if (typeof commandArgument === 'undefined' || !['upgrade', 'build', 'import', 'deploy'].includes(commandArgument)) {
|
|
9
9
|
console.error('Command [command] (upgrade, build, import, deploy) is required.');
|
|
10
|
-
return
|
|
10
|
+
return 1;
|
|
11
11
|
}
|
|
12
12
|
const runAll = commandArgument === 'deploy';
|
|
13
13
|
|
|
14
14
|
const pathArgument = args.find(a => ['-p', '--path'].includes(a));
|
|
15
15
|
if (typeof pathArgument === 'undefined') {
|
|
16
16
|
console.error('Path argument is required. Use --path to specify the path to solution folder.');
|
|
17
|
-
return
|
|
17
|
+
return 1;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const pathIndex = args.indexOf(pathArgument) + 1;
|
|
21
21
|
const path = args.at(pathIndex);
|
|
22
22
|
if (typeof path === 'undefined') {
|
|
23
23
|
console.error('Path argument is required. Use --path to specify the path to solution folder.');
|
|
24
|
-
return
|
|
24
|
+
return 1;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const envArgument = args.find(a => ['-env', '--environment'].includes(a));
|
|
@@ -32,11 +32,15 @@ if (envIndex > 0) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (commandArgument === 'upgrade' || runAll) {
|
|
35
|
-
upgradeTask.run(path);
|
|
35
|
+
const upgradeResult = upgradeTask.run(path);
|
|
36
|
+
if (upgradeResult === 1) return 1;
|
|
36
37
|
}
|
|
37
38
|
if (commandArgument === 'build' || runAll) {
|
|
38
|
-
buildTask.run(path);
|
|
39
|
+
const buildResult = buildTask.run(path);
|
|
40
|
+
if (buildResult === 1) return 1;
|
|
39
41
|
}
|
|
40
42
|
if (commandArgument === 'import' || runAll) {
|
|
41
|
-
importTask.run(path, env);
|
|
43
|
+
const importResult = importTask.run(path, env);
|
|
44
|
+
if (importResult === 1) return 1;
|
|
42
45
|
}
|
|
46
|
+
return 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tywalk/pcf-helper-run",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A simple command-line utility for building and publishing PCF controls to Dataverse.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node test.js"
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"author": "tywalk",
|
|
12
12
|
"bin": {
|
|
13
13
|
"pcf-helper-run": "./index.js"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@tywalk/pcf-helper": "^1.3.4"
|
|
14
17
|
}
|
|
15
|
-
}
|
|
18
|
+
}
|