@leverege/build-tools 2.53.3 → 2.53.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.53.3",
3
+ "version": "2.53.5",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -82,4 +82,4 @@
82
82
  "@leverege/eslint-config-leverege": "^4.2.0",
83
83
  "npm": "^10.8.3"
84
84
  }
85
- }
85
+ }
@@ -1,105 +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
- SHELLS=("bash" "dash" "zsh" "fish")
34
+ local SHELLS=("bash" "dash" "zsh" "fish")
34
35
 
35
- for shell in "${SHELLS[@]}"; do
36
- if command -v "$shell" > /dev/null 2>&1; then
37
- case "$shell" in
38
- bash)
39
- CONFIG_FILE="$HOME/.bashrc"
40
- ;;
41
- dash)
42
- CONFIG_FILE="$HOME/.profile"
43
- ;;
44
- zsh)
45
- CONFIG_FILE="$HOME/.zshrc"
46
- ;;
47
- fish)
48
- CONFIG_FILE="$HOME/.config/fish/config.fish"
49
- ;;
50
- *)
51
- echo "Shell $shell is not supported."
52
- continue
53
- ;;
54
- esac
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
55
56
 
56
- echo "Updating shell configuration in $CONFIG_FILE"
57
+ echo "Updating shell configuration in $CONFIG_FILE"
57
58
 
58
- if [ -f "$CONFIG_FILE" ]; then
59
- if grep -q "export UV_EXTRA_INDEX_URL=" "$CONFIG_FILE"; then
60
- 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
61
65
  else
62
66
  echo -e "\nexport UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}\n" >> "$CONFIG_FILE"
63
67
  fi
64
68
  else
65
- echo -e "\nexport UV_EXTRA_INDEX_URL=${UV_EXTRA_INDEX_URL}\n" >> "$CONFIG_FILE"
69
+ echo "Shell $shell is not installed."
66
70
  fi
67
- else
68
- echo "Shell $shell is not installed."
69
- fi
70
- done
71
-
72
- function get_parent_shell() {
73
- echo ""
71
+ done
72
+ echo -e "\n\n--- Please source your shell configuration to apply the changes.\n"
74
73
  }
75
74
 
76
- shell=$(get_parent_shell)
77
-
78
- if [ -z "$shell" ]; then
79
- echo -e "\nCould not determine parent shell. Please source your shell configuration to apply the changes.\n"
80
- echo "Example (bash): source ~/.bashrc"
81
- echo "Example (dash): source ~/.profile"
82
- echo "Example (zsh): source ~/.zshrc"
83
- echo "Example (fish): source ~/.config/fish/config.fish"
84
- exit 1
85
- fi
86
-
87
- echo -e "\nReloading $shell shell with new configuration.\n"
88
-
89
- case "$shell" in
90
- bash)
91
- source "$HOME/.bashrc"
92
- ;;
93
- dash)
94
- source "$HOME/.profile"
95
- ;;
96
- zsh)
97
- source "$HOME/.zshrc"
98
- ;;
99
- fish)
100
- fish
101
- ;;
102
- *)
103
- echo "Shell $shell is not supported."
104
- ;;
105
- esac
75
+ # this will be exposed in the case of calling '. refresh-py-idx'
76
+ leveregeBuildToolsRefreshPyIdx