@leverege/build-tools 2.53.4 → 2.53.6

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.
Files changed (28) hide show
  1. package/package.json +5 -6
  2. package/registry-compass.yaml +20 -0
  3. package/src/Docker.mjs +0 -1
  4. package/src/chart-compass.mjs +96 -0
  5. package/src/docker-to-registry.mjs +3 -2
  6. package/src/helm-charts/api-server/values-local.yaml +1 -1
  7. package/src/helm-charts/authz-server/values-local.yaml +1 -1
  8. package/src/helm-charts/cnpg-db-recovery/.nohelm +0 -0
  9. package/src/helm-charts/cnpg-db-recovery/.nohelmdn +0 -0
  10. package/src/helm-charts/cnpg-db-recovery/cluster.yaml.ovh +106 -0
  11. package/src/helm-charts/cnpg-db-recovery/gitignore +2 -0
  12. package/src/helm-charts/cnpg-db-recovery/helmdn.plugin +12 -0
  13. package/src/helm-charts/cnpg-db-recovery/helmup.plugin +6 -0
  14. package/src/helm-charts/cnpg-db-recovery/pooler.yaml +20 -0
  15. package/src/helm-charts/db-curator/values-local.yaml +1 -1
  16. package/src/helm-charts/elasticsearch8/helmup.plugin +1 -1
  17. package/src/helm-charts/imagine/values-local.yaml +1 -1
  18. package/src/helm-charts/pubsub-pulse/values-local.yaml +1 -2
  19. package/src/helm-charts/reason/values-local.yaml +1 -1
  20. package/src/helm-charts/redis/helmup.plugin +1 -1
  21. package/src/helm-charts/resource-server/values-local.yaml +1 -1
  22. package/src/helm-charts/rule-engine/values-local.yaml +1 -1
  23. package/src/helm-charts/scheduler/values-local.yaml +1 -1
  24. package/src/helm-charts/transponder-bq/values-local.yaml +1 -1
  25. package/src/helm-charts/transponder-dh/values-local.yaml +1 -1
  26. package/src/helm-charts/transponder-rt/values-local.yaml +1 -1
  27. package/src/helm-charts/transponder-tsdb/values-local.yaml +1 -1
  28. package/src/refresh-py-idx.sh +59 -90
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.53.4",
3
+ "version": "2.53.6",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -56,7 +56,6 @@
56
56
  "license": "SEE LICENSE IN LICENSE.md",
57
57
  "dependencies": {
58
58
  "@google-cloud/artifact-registry": "^3.4.0",
59
- "@leverege/build-tools": "^2.53.2-beta.1",
60
59
  "ansi-colors": "^4.1.3",
61
60
  "chalk": "^5.3.0",
62
61
  "command-line-args": "^6.0.0",
@@ -66,20 +65,20 @@
66
65
  "execa": "^9.4.0",
67
66
  "glob": "^11.0.0",
68
67
  "handlebars": "^4.7.8",
69
- "inquirer": "^11.1.0",
68
+ "inquirer": "^12.0.0",
70
69
  "js-yaml": "^4.1.0",
71
70
  "ms": "^2.1.3",
72
- "npm-registry-fetch": "^18.0.0",
71
+ "npm-registry-fetch": "^18.0.1",
73
72
  "package-up": "^5.0.0",
74
73
  "parse-gitignore": "^2.0.0",
75
74
  "read-pkg": "^9.0.1",
76
75
  "readline-sync": "^1.4.10",
77
76
  "semver": "^7.6.3",
78
77
  "simple-git": "^3.27.0",
79
- "zx": "^8.1.8"
78
+ "zx": "^8.1.9"
80
79
  },
81
80
  "devDependencies": {
82
81
  "@leverege/eslint-config-leverege": "^4.2.0",
83
- "npm": "^10.8.3"
82
+ "npm": "^10.9.0"
84
83
  }
85
84
  }
@@ -0,0 +1,20 @@
1
+ registry:
2
+ - root: us-docker.pkg.dev
3
+ - repositories:
4
+ - name: stack
5
+ charts:
6
+ - api-server
7
+ - authz-server
8
+ - emailer
9
+ - message-processor
10
+ - name: leverege
11
+ charts:
12
+ - pubsub-pulse
13
+ - pusher
14
+ - overdose
15
+ - name: cox-health
16
+ charts:
17
+ - actions-server
18
+ - analytics-server
19
+ - centrak-healthz
20
+ - centrak-ingestor
package/src/Docker.mjs CHANGED
@@ -304,7 +304,6 @@ const buildContainerImage = async ( {
304
304
  ${gcloudLogs} \\
305
305
  ${gcloudTags}
306
306
  ` ) )
307
-
308
307
 
309
308
  if ( process.env.DRY_RUN === '1' ) {
310
309
  log( '\n***Exiting from DRY_RUN\n' )
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * chart-to-registry will...
4
+ */
5
+ import fs from 'node:fs'
6
+
7
+ import chalk from 'chalk'
8
+ import commandLineArgs from 'command-line-args'
9
+ import commandLineUsage from 'command-line-usage'
10
+ import { lt as semverLt } from 'semver'
11
+ import YAML from 'js-yaml'
12
+
13
+ import {
14
+ condir,
15
+ debug,
16
+ errorExit,
17
+ log,
18
+ warning,
19
+ getGitRootDirectory,
20
+ parsePackageJson,
21
+ parseHelmChart,
22
+ shellCmd } from './Utils.mjs'
23
+
24
+ const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
25
+ /* eslint-disable max-len */
26
+ {
27
+ name : 'location',
28
+ type : String,
29
+ description : '{green the location of the artifact registry the chart will be pushed to (default us-docker.pkg.dev)}',
30
+ },
31
+ {
32
+ name : 'project',
33
+ type : String,
34
+ description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
35
+ },
36
+ {
37
+ name : 'repository',
38
+ type : String,
39
+ description : '{green the target repository to receive the pushed chart}',
40
+ },
41
+ {
42
+ name : 'dry-run',
43
+ type : Boolean,
44
+ description : '{yellow perform everything except the actual chart push}',
45
+ },
46
+ {
47
+ name : 'help',
48
+ type : Boolean,
49
+ description : '{green display this help screen}',
50
+ },
51
+ /* eslint-enable max-len */
52
+ ]
53
+
54
+ const sections = [
55
+ {
56
+ header : 'Leverege Helm Chart Compass (for helmup)',
57
+ content : `{green This tool helps helmup navigate the helm charts stored in the
58
+ artifact-registries.}`
59
+ },
60
+ { header : 'Options',
61
+ optionList : commandLineOptions,
62
+ },
63
+ ]
64
+
65
+ const args = commandLineArgs( commandLineOptions, { camelCase : true, partial : true } )
66
+ const usage = commandLineUsage( sections )
67
+
68
+ if ( args.help ) {
69
+ log( usage )
70
+ process.exit( 0 )
71
+ }
72
+
73
+ /* eslint-disable no-underscore-dangle */
74
+ if ( args._unknown ) {
75
+ log( usage )
76
+ log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
77
+ process.exit( 1 )
78
+ }
79
+ /* eslint-enable no-underscore-dangle */
80
+
81
+ const minNodejsVersion = '18.0.0'
82
+ if ( semverLt( process.version, minNodejsVersion ) ) {
83
+ errorExit( `\n***ERROR: must be running at least node ${minNodejsVersion}\n` )
84
+ }
85
+
86
+ // First of all, fail if we are not in a git repository
87
+ let gitRoot
88
+ try {
89
+ gitRoot = await getGitRootDirectory()
90
+ } catch ( error ) {
91
+ errorExit( chalk.red.bold( error ), { errorCode : 5 } )
92
+ }
93
+
94
+ const chartCompass = YAML.load( fs.readFileSync( './registry-compass.yaml', 'utf8' ) )
95
+
96
+ condir( { chartCompass }, '<==Navigation' )
@@ -33,7 +33,7 @@ for ( let n = 2; n < process.argv.length; n++ ) {
33
33
  if ( process.argv[n].startsWith( '-' ) ) {
34
34
  const str = process.argv[n].slice( 1 )
35
35
  if ( str.indexOf( '=' ) > 0 ) {
36
- const [key, value] = str.split( '=' )
36
+ const [ key, value ] = str.split( '=' )
37
37
  options[key] = value
38
38
  } else {
39
39
  options[str] = true
@@ -165,8 +165,9 @@ if ( giveGuidance ) {
165
165
  }
166
166
 
167
167
  // do chart checks too
168
+ let chart
168
169
  if ( options?.helmChecks !== 'false' ) {
169
- const chart = helmChart?.yaml['Chart.yaml']
170
+ chart = helmChart?.yaml['Chart.yaml']
170
171
  const values = helmChart?.yaml['values.yaml']
171
172
  const expectedChartRegistry = `${artifactRegistry}/images`
172
173
 
@@ -5,7 +5,7 @@
5
5
  # - node tools/UpdateESMappingV2.js
6
6
  #
7
7
  image:
8
- tag: # v5.12.3
8
+ tag: # v5.16.0
9
9
 
10
10
  config:
11
11
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -4,7 +4,7 @@
4
4
  # - npm run sequelizeRunMigrations
5
5
  #
6
6
  image:
7
- tag: # v2.1.3
7
+ tag: # v2.2.0
8
8
 
9
9
  config:
10
10
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
File without changes
File without changes
@@ -0,0 +1,106 @@
1
+ # Artifact Chart => https://artifacthub.io/packages/helm/cloudnative-pg/cloudnative-pg
2
+ # Examples Charts => https://cloudnative-pg.io/documentation/current/samples/
3
+ apiVersion: postgresql.cnpg.io/v1
4
+ kind: Cluster
5
+ metadata:
6
+ name: cnpg-db-recovery
7
+ namespace: cnpg-operands
8
+ spec:
9
+ instances: 1
10
+ logLevel: info # warning debug
11
+
12
+ monitoring:
13
+ enablePodMonitor: false # set true once monitoring is setup
14
+
15
+ description: "Leverege CNPG DB (recovered)"
16
+ imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.4-cnpg-tsdb2-rel.1
17
+ bootstrap:
18
+ recovery:
19
+ volumeSnapshots:
20
+ storage:
21
+ name: <snapshot_name>
22
+ kind: VolumeSnapshot
23
+ apiGroup: snapshot.storage.k8s.io
24
+
25
+ enableSuperuserAccess: true
26
+ superuserSecret:
27
+ name: <postgres_password> # postgres db pw
28
+
29
+ affinity:
30
+ enablePodAntiAffinity: true
31
+ topologyKey: kubernetes.io/hostname # default value
32
+ nodeAffinity:
33
+ requiredDuringSchedulingIgnoredDuringExecution:
34
+ nodeSelectorTerms:
35
+ - matchExpressions:
36
+ - key: target-env
37
+ operator: In
38
+ values:
39
+ - database
40
+ tolerations:
41
+ - key: "database"
42
+ operator: "Equal"
43
+ value: "true"
44
+ effect: "NoSchedule"
45
+
46
+ # Parameters and pg_hba configuration will be append
47
+ # to the default ones to make the cluster work
48
+ postgresql:
49
+ parameters:
50
+ # max_connections: "100"
51
+ # max_worker_processes: "60"
52
+ # max_worker_processes: "8"
53
+ # max_parallel_workers: "8"
54
+ # shared_buffers: 2GB
55
+ # effective_cache_size: 6GB
56
+ # maintenance_work_mem: 1GB
57
+ # work_mem: 20MB
58
+
59
+ # - unsupervised: automated update of the primary once all
60
+ # replicas have been upgraded (default)
61
+ # - supervised: requires manual supervision to perform
62
+ # the switchover of the primary
63
+ primaryUpdateStrategy: unsupervised
64
+
65
+ serviceAccountTemplate:
66
+ metadata:
67
+ annotations:
68
+ iam.gke.io/gcp-service-account: cnpg-operands-sa@OVH:<PROJECT_ID>.iam.gserviceaccount.com
69
+
70
+ # Require 50Gi of space per instance using ssd storage class
71
+ storage:
72
+ storageClass: premium-rwo
73
+ size: 50Gi
74
+ # walStorage:
75
+ # storageClass: premium-rwo
76
+ # size: 1Gi
77
+
78
+ backup:
79
+ retentionPolicy: 7d # don't think this does anything?
80
+ volumeSnapshot:
81
+ labels:
82
+ snapshotOf: cnpg-db-recovery
83
+ className: cnpg-snapshotclass
84
+ barmanObjectStore:
85
+ destinationPath: gs://OVH:<PROJECT_ID>-barman
86
+ googleCredentials:
87
+ gkeEnvironment: true
88
+ tags:
89
+ cnpgCluster: cnpg-db-recovery
90
+ wal:
91
+ compression: gzip
92
+ maxParallel: 8
93
+ ---
94
+ apiVersion: postgresql.cnpg.io/v1
95
+ kind: ScheduledBackup
96
+ metadata:
97
+ name: cnpg-db-recovery-backup
98
+ namespace: cnpg-operands
99
+ spec:
100
+ # https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
101
+ schedule: "0 0 */12 * * *"
102
+ cluster:
103
+ name: cnpg-db-recovery
104
+ method: volumeSnapshot # barmanObjectStore
105
+ backupOwnerReference: self
106
+ immediate: true
@@ -0,0 +1,2 @@
1
+ *.swp
2
+ cluster.yaml
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ #
3
+ # We only want to hibernate unless the intent is to really delete EVERYTHING
4
+ # which includes PVCs and volume snapshots.
5
+ #
6
+ printf "\nHibernating the cnpg-db-recovery cluster...\n"
7
+ kubectl cnpg hibernate on -n cnpg-operands cnpg-db-recovery
8
+
9
+ # *** DANGER ***
10
+ # kubectl delete will destroy the cluster
11
+ # *** DANGER ***
12
+ # kubectl delete -f cnpg-db-recovery/cluster.yaml $K8S_WHAT
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ # ensures the PG_PASSWORD secret exists and correct
4
+ # ensureCnpgSecret PG_PASSWORD $SERVICE-postgres-pw
5
+
6
+ kubectl apply -f cnpg-db-recovery/cluster.yaml $K8S_WHAT
@@ -0,0 +1,20 @@
1
+ apiVersion: postgresql.cnpg.io/v1
2
+ kind: Pooler
3
+ metadata:
4
+ name: cnpg-db-recovery-pool-rw
5
+ namespace: cnpg-operands
6
+ spec:
7
+ cluster:
8
+ name: cnpg-db-recovery
9
+
10
+ instances: 1
11
+ type: rw
12
+ pgbouncer:
13
+ poolMode: session
14
+ parameters:
15
+ # https://www.pgbouncer.org/config.html#generic-settings
16
+ max_client_conn: "500"
17
+ default_pool_size: "10"
18
+ # https://www.pgbouncer.org/config.html#log-settings
19
+ log_connections: "0"
20
+ log_disconnections: "0"
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v4.2.4
2
+ tag: # v4.3.0
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -2,7 +2,7 @@
2
2
  #
3
3
  showInstalling "Elastic Search 8"
4
4
 
5
- [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.3.17"
5
+ [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.3.20"
6
6
 
7
7
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/elasticsearch"
8
8
 
@@ -1,5 +1,5 @@
1
1
  mage:
2
- tag: # v2.2.0
2
+ tag: # v2.4.1
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,6 +1,5 @@
1
1
  image:
2
- tag: # v1.3.5
3
- # registry: gcr.io/leverege-docker-images # deprecated
2
+ tag: # v1.6.3
4
3
  # registry: us-docker.pkg.dev/leverege-registry/leverege/images
5
4
 
6
5
  config:
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v2.2.1
2
+ tag: # v2.3.0
3
3
 
4
4
  config:
5
5
  CF_TRANSPORT_CONFIG: '{
@@ -4,7 +4,7 @@ showInstalling "Redis"
4
4
 
5
5
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/redis"
6
6
 
7
- [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.1.3"
7
+ [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.1.7"
8
8
 
9
9
  helm upgrade --install redis $OCI_CHART \
10
10
  --values redis/redis-local.yaml \
@@ -4,7 +4,7 @@
4
4
  # - npm run sequelizeRunMigrations
5
5
  #
6
6
  image:
7
- tag: # v1.2.2
7
+ tag: # v1.5.1
8
8
 
9
9
  config:
10
10
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v2.3.1
2
+ tag: # v2.6.0
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v3.1.1
2
+ tag: # v3.1.2
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -1,7 +1,7 @@
1
1
  nameOverride: transponder-bq
2
2
 
3
3
  image:
4
- tag: # v5.2.2
4
+ tag: # v5.2.4
5
5
 
6
6
  config:
7
7
  TRANSPONDER_RUN_MODE: "bigQueryJson"
@@ -1,7 +1,7 @@
1
1
  nameOverride: transponder-dh
2
2
 
3
3
  image:
4
- tag: # v5.2.2
4
+ tag: # v5.2.4
5
5
 
6
6
  config:
7
7
  TRANSPONDER_RUN_MODE: "denseHistoryCombined"
@@ -1,7 +1,7 @@
1
1
  nameOverride: transponder-rt
2
2
 
3
3
  image:
4
- tag: # v5.2.2
4
+ tag: # v5.2.4
5
5
 
6
6
  config:
7
7
  TRANSPONDER_RUN_MODE: "rt"
@@ -7,7 +7,7 @@
7
7
  nameOverride: transponder-tsdb
8
8
 
9
9
  image:
10
- tag: # v5.2.2
10
+ tag: # v5.2.4
11
11
 
12
12
  config:
13
13
  TRANSPONDER_RUN_MODE: "timescale"
@@ -1,107 +1,76 @@
1
1
  #!/bin/bash
2
2
 
3
- # Execute gcloud command to get the token
4
- TOKEN=$(gcloud auth print-access-token)
3
+ function leveregeBuildToolsRefreshPyIdx() {
4
+ # Execute gcloud command to get the token
5
+ local TOKEN=$(gcloud auth print-access-token)
5
6
 
6
- # Write to pip.conf
7
- PIP_CONFIG_DIR="$HOME/.config/pip"
8
- mkdir -p "$PIP_CONFIG_DIR"
9
- PIP_CONFIG_CONTENT="
10
- [global]
11
- extra-index-url = https://oauth2accesstoken:${TOKEN}@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple/
12
- "
13
- echo "$PIP_CONFIG_CONTENT" > "$PIP_CONFIG_DIR/pip.conf"
14
- echo "Updated ~/.config/pip/pip.conf"
7
+ # Write to pip.conf
8
+ local PIP_CONFIG_DIR="$HOME/.config/pip"
9
+ mkdir -p "$PIP_CONFIG_DIR"
10
+ local PIP_CONFIG_CONTENT="
11
+ [global]
12
+ extra-index-url = https://oauth2accesstoken:${TOKEN}@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple/
13
+ "
14
+ echo "$PIP_CONFIG_CONTENT" > "$PIP_CONFIG_DIR/pip.conf"
15
+ echo "Updated ~/.config/pip/pip.conf"
15
16
 
16
- # Write to pypirc
17
- PYPIRC_CONTENT="
18
- [distutils]
19
- index-servers =
20
- leverege-python-packages
17
+ # Write to pypirc
18
+ local PYPIRC_CONTENT="
19
+ [distutils]
20
+ index-servers =
21
+ leverege-python-packages
21
22
 
22
- [leverege-python-packages]
23
- repository: https://us-python.pkg.dev/leverege-registry/leverege-python-packages/
24
- username: oauth2accesstoken
25
- password: ${TOKEN}
26
- "
27
- echo "$PYPIRC_CONTENT" > "$HOME/.pypirc"
28
- echo "Updated ~/.pypirc"
23
+ [leverege-python-packages]
24
+ repository: https://us-python.pkg.dev/leverege-registry/leverege-python-packages/
25
+ username: oauth2accesstoken
26
+ password: ${TOKEN}
27
+ "
28
+ echo "$PYPIRC_CONTENT" > "$HOME/.pypirc"
29
+ echo "Updated ~/.pypirc"
29
30
 
30
- # Escape for sed
31
- UV_EXTRA_INDEX_URL="https://oauth2accesstoken:${TOKEN}@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple"
31
+ # Escape for sed
32
+ UV_EXTRA_INDEX_URL="https://oauth2accesstoken:${TOKEN}@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple"
32
33
 
33
- export UV_EXTRA_INDEX_URL="https://oauth2accesstoken:${TOKEN}@us-python.pkg.dev/leverege-registry/leverege-python-packages/simple"
34
+ local SHELLS=("bash" "dash" "zsh" "fish")
34
35
 
35
- SHELLS=("bash" "dash" "zsh" "fish")
36
+ for shell in "${SHELLS[@]}"; do
37
+ if command -v "$shell" > /dev/null 2>&1; then
38
+ case "$shell" in
39
+ bash)
40
+ CONFIG_FILE="$HOME/.bashrc"
41
+ ;;
42
+ dash)
43
+ CONFIG_FILE="$HOME/.profile"
44
+ ;;
45
+ zsh)
46
+ CONFIG_FILE="$HOME/.zshrc"
47
+ ;;
48
+ fish)
49
+ CONFIG_FILE="$HOME/.config/fish/config.fish"
50
+ ;;
51
+ *)
52
+ echo "Shell $shell is not supported."
53
+ continue
54
+ ;;
55
+ esac
36
56
 
37
- for shell in "${SHELLS[@]}"; do
38
- if command -v "$shell" > /dev/null 2>&1; then
39
- case "$shell" in
40
- bash)
41
- CONFIG_FILE="$HOME/.bashrc"
42
- ;;
43
- dash)
44
- CONFIG_FILE="$HOME/.profile"
45
- ;;
46
- zsh)
47
- CONFIG_FILE="$HOME/.zshrc"
48
- ;;
49
- fish)
50
- CONFIG_FILE="$HOME/.config/fish/config.fish"
51
- ;;
52
- *)
53
- echo "Shell $shell is not supported."
54
- continue
55
- ;;
56
- esac
57
+ echo "Updating shell configuration in $CONFIG_FILE"
57
58
 
58
- echo "Updating shell configuration in $CONFIG_FILE"
59
-
60
- if [ -f "$CONFIG_FILE" ]; then
61
- if grep -q "export UV_EXTRA_INDEX_URL=" "$CONFIG_FILE"; then
62
- sed -i '' "s|export UV_EXTRA_INDEX_URL=.*|export UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}|" "$CONFIG_FILE"
59
+ if [ -f "$CONFIG_FILE" ]; then
60
+ if grep -q "export UV_EXTRA_INDEX_URL=" "$CONFIG_FILE"; then
61
+ sed -i '' "s|export UV_EXTRA_INDEX_URL=.*|export UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}|" "$CONFIG_FILE"
62
+ else
63
+ echo -e "\nexport UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}\n" >> "$CONFIG_FILE"
64
+ fi
63
65
  else
64
66
  echo -e "\nexport UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}\n" >> "$CONFIG_FILE"
65
67
  fi
66
68
  else
67
- echo -e "\nexport UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}\n" >> "$CONFIG_FILE"
69
+ echo "Shell $shell is not installed."
68
70
  fi
69
- else
70
- echo "Shell $shell is not installed."
71
- fi
72
- done
73
-
74
- function get_parent_shell() {
75
- echo ""
71
+ done
72
+ echo -e "\n\n--- Please source your shell configuration to apply the changes.\n"
76
73
  }
77
74
 
78
- shell=$(get_parent_shell)
79
-
80
- if [ -z "$shell" ]; then
81
- echo -e "\nCould not determine parent shell. Please source your shell configuration to apply the changes.\n"
82
- echo "Example (bash): source ~/.bashrc"
83
- echo "Example (dash): source ~/.profile"
84
- echo "Example (zsh): source ~/.zshrc"
85
- echo "Example (fish): source ~/.config/fish/config.fish"
86
- exit 1
87
- fi
88
-
89
- echo -e "\nReloading $shell shell with new configuration.\n"
90
-
91
- case "$shell" in
92
- bash)
93
- source "$HOME/.bashrc"
94
- ;;
95
- dash)
96
- source "$HOME/.profile"
97
- ;;
98
- zsh)
99
- source "$HOME/.zshrc"
100
- ;;
101
- fish)
102
- fish
103
- ;;
104
- *)
105
- echo "Shell $shell is not supported."
106
- ;;
107
- esac
75
+ # this will be exposed in the case of calling '. refresh-py-idx'
76
+ leveregeBuildToolsRefreshPyIdx