datagrok-tools 4.7.2 → 4.7.4
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/bin/commands/test.js +8 -6
- package/package.json +1 -1
package/bin/commands/test.js
CHANGED
|
@@ -79,23 +79,25 @@ function test(args) {
|
|
|
79
79
|
var packageData = JSON.parse(_fs["default"].readFileSync(_path["default"].join(curDir, 'package.json'), {
|
|
80
80
|
encoding: 'utf-8'
|
|
81
81
|
}));
|
|
82
|
-
var fullName = packageData.friendlyName || packageData.fullName;
|
|
83
82
|
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
process.env.TARGET_PACKAGE = fullName;
|
|
83
|
+
if (packageData.name) {
|
|
84
|
+
process.env.TARGET_PACKAGE = utils.kebabToCamelCase(utils.removeScope(packageData.name));
|
|
87
85
|
console.log('Environment variable `TARGET_PACKAGE` is set to', process.env.TARGET_PACKAGE);
|
|
88
86
|
} else {
|
|
89
|
-
color.error('Invalid
|
|
87
|
+
color.error('Invalid package name. Set the `name` field in `package.json`');
|
|
90
88
|
return false;
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
color.info("Building package...");
|
|
94
92
|
(0, _child_process.exec)('npm run build', function (err, stdout, stderr) {
|
|
95
|
-
if (err)
|
|
93
|
+
if (err) {
|
|
94
|
+
console.log(stdout);
|
|
95
|
+
throw err;
|
|
96
|
+
} else {
|
|
96
97
|
console.log(stdout);
|
|
97
98
|
color.warn(stderr);
|
|
98
99
|
}
|
|
100
|
+
|
|
99
101
|
color.info("Publishing package \"".concat(process.env.TARGET_PACKAGE, "\" to ").concat(process.env.HOST, "..."));
|
|
100
102
|
(0, _child_process.exec)("grok publish ".concat(process.platform === 'win32' ? '%HOST%' : '${HOST}'), function (err, stdout, stderr) {
|
|
101
103
|
if (err) throw err;else {
|
package/package.json
CHANGED