@sdlcai/setup 0.3.0 → 0.3.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/bin/cli.mjs +9 -22
- package/package.json +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -19,9 +19,10 @@ const SCOPE = '@avanade-region-iceg';
|
|
|
19
19
|
|
|
20
20
|
// asset name -> private installer package + default args
|
|
21
21
|
const ASSETS = {
|
|
22
|
-
'ava-custom-agents': { pkg: '@avanade-region-iceg/ava-agents',
|
|
23
|
-
'ava-agents': { pkg: '@avanade-region-iceg/ava-agents',
|
|
24
|
-
'mnemo': { pkg: '@avanade-region-iceg/mnemo-setup',
|
|
22
|
+
'ava-custom-agents': { pkg: '@avanade-region-iceg/ava-agents', args: ['install'], label: 'AVA custom agents' },
|
|
23
|
+
'ava-agents': { pkg: '@avanade-region-iceg/ava-agents', args: ['install'], label: 'AVA custom agents' },
|
|
24
|
+
'mnemo': { pkg: '@avanade-region-iceg/mnemo-setup', args: [], label: 'mnemo (memory)' },
|
|
25
|
+
'gh-mnemo': { pkg: '@avanade-region-iceg/gh-mnemo', args: [], label: 'mnemo gh extension' },
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const WIN = process.platform === 'win32';
|
|
@@ -33,26 +34,11 @@ const ok = (cmd, args) => spawnSync(cmd, args, { encoding: 'utf8', shell: WIN })
|
|
|
33
34
|
|
|
34
35
|
function ensureGh() {
|
|
35
36
|
if (out('gh', ['--version'])) return;
|
|
36
|
-
|
|
37
|
-
let attempted = false;
|
|
38
|
-
if (WIN) {
|
|
39
|
-
attempted = true;
|
|
40
|
-
run('winget', ['install', '--id', 'GitHub.cli', '-e',
|
|
41
|
-
'--accept-package-agreements', '--accept-source-agreements']);
|
|
42
|
-
} else if (process.platform === 'darwin') {
|
|
43
|
-
attempted = true;
|
|
44
|
-
run('brew', ['install', 'gh']);
|
|
45
|
-
}
|
|
46
|
-
if (out('gh', ['--version'])) { info('✓ gh installed.'); return; }
|
|
47
|
-
if (attempted) {
|
|
48
|
-
die('gh was installed but is not yet in PATH.\n' +
|
|
49
|
-
' Close this terminal, reopen it, and re-run the command.');
|
|
50
|
-
}
|
|
51
|
-
die('GitHub CLI (gh) is required for the secure browser login.\n' +
|
|
52
|
-
' Install it — https://cli.github.com — then re-run:\n' +
|
|
37
|
+
die('GitHub CLI (gh) is required — install it first, then re-run:\n' +
|
|
53
38
|
' Windows: winget install GitHub.cli\n' +
|
|
54
39
|
' macOS: brew install gh\n' +
|
|
55
|
-
' Linux: see https://github.com/cli/cli#installation'
|
|
40
|
+
' Linux: see https://github.com/cli/cli#installation\n' +
|
|
41
|
+
' https://cli.github.com');
|
|
56
42
|
}
|
|
57
43
|
|
|
58
44
|
function tokenScopes() {
|
|
@@ -114,7 +100,8 @@ configures GitHub Packages auth, then runs the asset's installer.
|
|
|
114
100
|
|
|
115
101
|
Examples:
|
|
116
102
|
sdlcai ava-custom-agents
|
|
117
|
-
sdlcai mnemo -- --local --scope user --project acme --yes
|
|
103
|
+
sdlcai mnemo -- --local --scope user --project acme --yes
|
|
104
|
+
sdlcai gh-mnemo`);
|
|
118
105
|
process.exit(exit);
|
|
119
106
|
}
|
|
120
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdlcai/setup",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "One-command bootstrap for private Avanade dev-tool assets (AVA agents, mnemo, …): GitHub browser login + Avanade-Region-ICEG access gate + install.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|