@affinidi/cli 1.31.1 → 1.31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@affinidi/cli",
3
- "version": "1.31.1",
3
+ "version": "1.31.2",
4
4
  "description": "Affinidi Elements command-line-interface",
5
5
  "author": "affinidi.com",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "prepare": "node -e \"process.exit(process.env.NODE_ENV === 'production' ? 0 : 1)\" || npm run prepare:dev",
34
34
  "remove:dist": "shx rm -rf dist",
35
35
  "generate:api": "node scripts/generate-api.cjs",
36
- "postinstall": "node -e \"process.exit(process.env.NODE_ENV === 'production' ? 1 : 0)\" || node scripts/autocomplete.cjs"
36
+ "postinstall": "node scripts/autocomplete.cjs"
37
37
  },
38
38
  "publishConfig": {
39
39
  "registry": "https://registry.npmjs.org/",
@@ -1,11 +1,15 @@
1
1
  const { exec } = require('child_process')
2
+ const {CliUx} = require('@oclif/core')
2
3
 
3
- exec('echo $SHELL', (err, stdout, stderr) => {
4
+ exec('echo $SHELL', async (err, stdout, stderr) => {
4
5
  if (err) {
5
6
  // node couldn't execute the command
6
7
  return
7
8
  }
8
-
9
+ const answers = await CliUx.ux.prompt(`Please confirm that you want to activate autocompletion [Y/n].(it will add several lines to your ./${stdout.split('/').at(-1)}rc file`, {
10
+ default: 'n',
11
+ })
12
+ if (answers.toLowerCase() === 'y'){
9
13
  if(stdout.includes('zsh')){
10
14
  execEnvVarCommand('zsh')
11
15
  return
@@ -14,7 +18,8 @@ exec('echo $SHELL', (err, stdout, stderr) => {
14
18
  execEnvVarCommand('bash')
15
19
  return
16
20
  }
17
- console.log('Auto-completion supports only zsh or bash shells.')
21
+ console.log('Auto-completion supports only zsh or bash shells.') }
22
+ console.log('Auto-completion not activated. To activate in future run npm install')
18
23
  })
19
24
 
20
25
  const execEnvVarCommand = (shell) => {