abapgit-agent 1.13.4 → 1.13.5
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/abapgit-agent +6 -0
- package/package.json +1 -1
- package/src/commands/help.js +3 -1
- package/src/utils/version-check.js +2 -1
package/bin/abapgit-agent
CHANGED
|
@@ -36,6 +36,12 @@ async function main() {
|
|
|
36
36
|
|
|
37
37
|
const commandModules = require('../src/commands/index');
|
|
38
38
|
|
|
39
|
+
// Handle --version / -v
|
|
40
|
+
if (command === '--version' || command === '-v') {
|
|
41
|
+
console.log(versionCheck.getCliVersion());
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
// Check if this is a modular command
|
|
40
46
|
if (commandModules[command] || command === '--help' || command === '-h') {
|
|
41
47
|
const cmd = command === '--help' || command === '-h' ? commandModules.help : commandModules[command];
|
package/package.json
CHANGED
package/src/commands/help.js
CHANGED
|
@@ -9,8 +9,10 @@ module.exports = {
|
|
|
9
9
|
requiresVersionCheck: false,
|
|
10
10
|
|
|
11
11
|
async execute(args, context) {
|
|
12
|
+
const { versionCheck } = context;
|
|
13
|
+
const version = versionCheck.getCliVersion();
|
|
12
14
|
console.log(`
|
|
13
|
-
ABAP Git Agent
|
|
15
|
+
ABAP Git Agent v${version}
|
|
14
16
|
|
|
15
17
|
Usage:
|
|
16
18
|
abapgit-agent <command> [options]
|
|
@@ -135,7 +135,8 @@ async function getLatestNpmVersion() {
|
|
|
135
135
|
const baseUrl = registry.endsWith('/') ? registry : registry + '/';
|
|
136
136
|
const url = `${baseUrl}abapgit-agent/latest`;
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
const client = url.startsWith('http://') ? http : https;
|
|
139
|
+
client.get(url, (res) => {
|
|
139
140
|
let body = '';
|
|
140
141
|
res.on('data', chunk => body += chunk);
|
|
141
142
|
res.on('end', () => {
|